From: Greg Hudson Date: Tue, 5 May 2009 16:55:58 +0000 (+0000) Subject: In pa_sam_2, free scratch in a couple of error-handling blocks where X-Git-Tag: krb5-1.8-alpha1~493 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f49e0727a2d42b5958384008a5fe2088e5957833;p=krb5.git In pa_sam_2, free scratch in a couple of error-handling blocks where it was live and not freed. The function should be reorganized to use a cleanup handler, but (I believe) is not covered by the test suite and should not undergo such major surgery until it is. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22314 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index 542c2fa5d..442f6a767 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -1652,6 +1652,7 @@ krb5_error_code pa_sam_2(krb5_context context, if (retval) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); + krb5_free_data(context, scratch); return(retval); } sr2.sam_enc_nonce_or_sad.ciphertext.length = ciph_len; @@ -1662,6 +1663,7 @@ krb5_error_code pa_sam_2(krb5_context context, if (!sr2.sam_enc_nonce_or_sad.ciphertext.data) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); + krb5_free_data(context, scratch); return(ENOMEM); }