From: Greg Hudson Date: Tue, 5 May 2009 16:00:40 +0000 (+0000) Subject: Fix a case in the krb5_rd_rep error handler (introduced in the last X-Git-Tag: krb5-1.8-alpha1~498 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=963d72c9b874e51a98dd674bb9e62ba0f0a9f5f7;p=krb5.git Fix a case in the krb5_rd_rep error handler (introduced in the last commit) where scratch.data could be indirected through even if it wasn't allocated successfully. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22309 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/rd_rep.c b/src/lib/krb5/krb/rd_rep.c index fe6c76375..1e3c14526 100644 --- a/src/lib/krb5/krb/rd_rep.c +++ b/src/lib/krb5/krb/rd_rep.c @@ -145,10 +145,11 @@ krb5_rd_rep(krb5_context context, krb5_auth_context auth_context, enc = NULL; clean_scratch: - memset(scratch.data, 0, scratch.length); + if (scratch.data) + memset(scratch.data, 0, scratch.length); + free(scratch.data); krb5_free_ap_rep(context, reply); krb5_free_ap_rep_enc_part(context, enc); - free(scratch.data); return retval; }