From 963d72c9b874e51a98dd674bb9e62ba0f0a9f5f7 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Tue, 5 May 2009 16:00:40 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/rd_rep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.26.2