From: Ezra Peisach Date: Sat, 16 Aug 2008 13:01:40 +0000 (+0000) Subject: In copying a credential - if we run out memory - the cleanup code failed to clear... X-Git-Tag: krb5-1.7-alpha1~483 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98428ac61a8273ada2ccd6b3f997b300eb31c246;p=krb5.git In copying a credential - if we run out memory - the cleanup code failed to clear the second_ticket git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20666 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/copy_creds.c b/src/lib/krb5/krb/copy_creds.c index 417a9a449..f011a03ce 100644 --- a/src/lib/krb5/krb/copy_creds.c +++ b/src/lib/krb5/krb/copy_creds.c @@ -84,20 +84,22 @@ krb5int_copy_creds_contents(krb5_context context, const krb5_creds *incred, krb5_xfree(scratch); retval = krb5_copy_data(context, &incred->second_ticket, &scratch); if (retval) - goto cleanticket; + goto clearticket; tempcred->second_ticket = *scratch; krb5_xfree(scratch); retval = krb5_copy_authdata(context, incred->authdata,&tempcred->authdata); if (retval) - goto clearticket; + goto clearsecondticket; return 0; + clearsecondticket: + memset(tempcred->second_ticket.data,0,tempcred->second_ticket.length); + free(tempcred->second_ticket.data); clearticket: memset(tempcred->ticket.data,0,tempcred->ticket.length); - cleanticket: free(tempcred->ticket.data); cleanaddrs: krb5_free_addresses(context, tempcred->addresses);