cleanup addrs on errors
authorJohn Kohl <jtkohl@mit.edu>
Fri, 4 May 1990 17:07:13 +0000 (17:07 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 4 May 1990 17:07:13 +0000 (17:07 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@739 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/gc_via_tgt.c

index c4e9db6a48bf72fc0e281a067945fb34e4edb813..bf1ab5bfcb2775f5505af61aae0b50c2864d43a7 100644 (file)
@@ -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;
 }