on error, so it needs to silently succeed when deleting a null context.
It was instead passing the null context along to the mechglue which
would produce an error, causing a leak of the mechglue's union context
wrapper. Reported by aberry@likewise.com.
ticket: 6863
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24692
dc483132-0cff-0310-8789-
dd5450dbe970
spnego_gss_ctx_id_t *ctx =
(spnego_gss_ctx_id_t *)context_handle;
+ *minor_status = 0;
+
if (context_handle == NULL)
return (GSS_S_FAILURE);
+ if (*ctx == NULL)
+ return (GSS_S_COMPLETE);
+
/*
* If this is still an SPNEGO mech, release it locally.
*/
- if (*ctx != NULL &&
- (*ctx)->magic_num == SPNEGO_MAGIC_ID) {
+ if ((*ctx)->magic_num == SPNEGO_MAGIC_ID) {
(void) gss_delete_sec_context(minor_status,
&(*ctx)->ctx_handle,
output_token);