From: Greg Hudson Date: Thu, 18 Feb 2010 18:49:11 +0000 (+0000) Subject: The TGS code was not freeing authdata. This is an old leak which was X-Git-Tag: krb5-1.9-beta1~343 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cdb89c32a7df8fd709be8ba27756e52776e8db94;p=krb5.git The TGS code was not freeing authdata. This is an old leak which was made more evident in 1.8 by the addition of ad-signedpath authdata appearing in most tickets issued through the TGS path. ticket: 6659 target_version: 1.8 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23735 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c index 44b5791bc..f80827690 100644 --- a/src/kdc/do_tgs_req.c +++ b/src/kdc/do_tgs_req.c @@ -136,6 +136,7 @@ process_tgs_req(krb5_data *pkt, const krb5_fulladdr *from, reply.padata = 0; /* For cleanup handler */ reply_encpart.enc_padata = 0; + enc_tkt_reply.authorization_data = NULL; e_data.data = NULL; session_key.contents = NULL; @@ -726,8 +727,6 @@ tgt_again: } } - enc_tkt_reply.authorization_data = NULL; - if (isflagset(c_flags, KRB5_KDB_FLAG_PROTOCOL_TRANSITION) && !isflagset(c_flags, KRB5_KDB_FLAG_CROSS_REALM)) enc_tkt_reply.client = s4u_x509_user->user_id.user; @@ -1045,6 +1044,8 @@ cleanup: krb5_free_pa_data(kdc_context, reply.padata); if (reply_encpart.enc_padata) krb5_free_pa_data(kdc_context, reply_encpart.enc_padata); + if (enc_tkt_reply.authorization_data != NULL) + krb5_free_authdata(kdc_context, enc_tkt_reply.authorization_data); krb5_free_data_contents(kdc_context, &e_data); return retval;