From 5da01b50554199e0ea275581755af4dce5b27f6d Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Tue, 22 Feb 2011 20:30:24 +0000 Subject: [PATCH] Don't leak the mechanism internal context when we get an error in the mechglue's gss_accept_sec_context. From aberry@likewise.com. ticket: 6813 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24645 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/mechglue/g_accept_sec_context.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/gssapi/mechglue/g_accept_sec_context.c b/src/lib/gssapi/mechglue/g_accept_sec_context.c index d585de787..cf21c1513 100644 --- a/src/lib/gssapi/mechglue/g_accept_sec_context.c +++ b/src/lib/gssapi/mechglue/g_accept_sec_context.c @@ -352,9 +352,14 @@ error_out: if (union_ctx_id->mech_type->elements) free(union_ctx_id->mech_type->elements); free(union_ctx_id->mech_type); - *context_handle = GSS_C_NO_CONTEXT; + } + if (union_ctx_id->internal_ctx_id && mech->gss_delete_sec_context) { + mech->gss_delete_sec_context(&temp_minor_status, + &union_ctx_id->internal_ctx_id, + GSS_C_NO_BUFFER); } free(union_ctx_id); + *context_handle = GSS_C_NO_CONTEXT; } if (src_name) -- 2.26.2