From: John Kohl Date: Fri, 4 May 1990 17:07:13 +0000 (+0000) Subject: cleanup addrs on errors X-Git-Tag: krb5-1.0-alpha2~663 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f4f7b7695fd60e909e23728f015639f695de08a;p=krb5.git cleanup addrs on errors git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@739 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/gc_via_tgt.c b/src/lib/krb5/krb/gc_via_tgt.c index c4e9db6a4..bf1ab5bfc 100644 --- a/src/lib/krb5/krb/gc_via_tgt.c +++ b/src/lib/krb5/krb/gc_via_tgt.c @@ -128,11 +128,13 @@ OLDDECLARG(krb5_creds *, cred) return retval; } - retval = krb5_encode_ticket(dec_rep->ticket, &scratch); - if (!retval) { + if (retval = krb5_encode_ticket(dec_rep->ticket, &scratch)) + krb5_free_address(creds->addresses); + else { cred->ticket = *scratch; free((char *)scratch); } + cleanup(); return retval; }