From 98428ac61a8273ada2ccd6b3f997b300eb31c246 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sat, 16 Aug 2008 13:01:40 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/copy_creds.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.26.2