From: Greg Hudson Date: Wed, 20 Jul 2011 20:44:31 +0000 (+0000) Subject: Fix memory leak of accprinc in kg_accept_krb5() X-Git-Tag: krb5-1.10-alpha1~346 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0afd0d480206673688285de9e97b69b4dcdd5639;p=krb5.git Fix memory leak of accprinc in kg_accept_krb5() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25029 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index a291b7eba..e45c6711c 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -640,8 +640,10 @@ kg_accept_krb5(minor_status, context_handle, } } - if ((code = krb5_rd_req(context, &auth_context, &ap_req, accprinc, - cred->keytab, &ap_req_options, &ticket))) { + code = krb5_rd_req(context, &auth_context, &ap_req, accprinc, + cred->keytab, &ap_req_options, &ticket); + krb5_free_principal(context, accprinc); + if (code) { major_status = GSS_S_FAILURE; goto fail; }