(gss_delete_sec_context): if the context handle is GSS_C_NO_CONTEXT,

don't fall over.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16569 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-01-16 13:12:29 +00:00
parent 3e9fc4053a
commit 20beaf630b
2 changed files with 10 additions and 2 deletions

View File

@@ -43,11 +43,16 @@ OM_uint32 gss_delete_sec_context
{
GSSAPI_KRB5_INIT ();
*minor_status = 0;
if (output_token) {
output_token->length = 0;
output_token->value = NULL;
}
if (*context_handle == GSS_C_NO_CONTEXT)
return GSS_S_COMPLETE;
HEIMDAL_MUTEX_lock(&(*context_handle)->ctx_id_mutex);
krb5_auth_con_free (gssapi_krb5_context,
@@ -69,6 +74,5 @@ OM_uint32 gss_delete_sec_context
memset(*context_handle, 0, sizeof(**context_handle));
free (*context_handle);
*context_handle = GSS_C_NO_CONTEXT;
*minor_status = 0;
return GSS_S_COMPLETE;
}