From 0afd0d480206673688285de9e97b69b4dcdd5639 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Wed, 20 Jul 2011 20:44:31 +0000 Subject: [PATCH] Fix memory leak of accprinc in kg_accept_krb5() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25029 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/accept_sec_context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.26.2