From 0e5cd3f9b69cd10df18f86d96a65de777fa25696 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 23 Mar 2010 22:00:13 +0000 Subject: [PATCH] Apply patch from Arlene Berry to not use freed memory in gss_import_sec_context in some error paths. ticket: 6678 target_version: 1.8.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23834 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/import_sec_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/gssapi/krb5/import_sec_context.c b/src/lib/gssapi/krb5/import_sec_context.c index d4ef1e345..30ec2309e 100644 --- a/src/lib/gssapi/krb5/import_sec_context.c +++ b/src/lib/gssapi/krb5/import_sec_context.c @@ -106,12 +106,13 @@ krb5_gss_import_sec_context(minor_status, interprocess_token, context_handle) ibp = (krb5_octet *) interprocess_token->value; blen = (size_t) interprocess_token->length; kret = kg_ctx_internalize(context, (krb5_pointer *) &ctx, &ibp, &blen); - krb5_free_context(context); if (kret) { *minor_status = (OM_uint32) kret; save_error_info(*minor_status, context); + krb5_free_context(context); return(GSS_S_FAILURE); } + krb5_free_context(context); /* intern the context handle */ if (! kg_save_ctx_id((gss_ctx_id_t) ctx)) { -- 2.26.2