don't free/clean up a ticket we're returning
authorJohn Kohl <jtkohl@mit.edu>
Fri, 22 Mar 1991 10:13:18 +0000 (10:13 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 22 Mar 1991 10:13:18 +0000 (10:13 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1946 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/gc_frm_kdc.c

index 321922ed20228f4a24d45d984ed94270d518ca81..f98f1aa0497e4da4adf39ffe7c8738b4ffd974ff 100644 (file)
@@ -63,6 +63,7 @@ krb5_get_cred_from_kdc (ccache, cred, tgts)
     krb5_principal final_server;
     krb5_error_code retval;
     int nservers;
+    int returning_tgt = 0;
     krb5_enctype etype;
 
     /* in case we never get a TGT, zero the return */
@@ -202,6 +203,7 @@ krb5_get_cred_from_kdc (ccache, cred, tgts)
                goto out;
            }
            tgt = *ret_tgts[nservers];
+           returning_tgt = 1;          /* don't free it below... */
            tgtq.client = 0;
            tgtq.server = 0;
            krb5_free_cred_contents(&tgtq);
@@ -220,7 +222,8 @@ krb5_get_cred_from_kdc (ccache, cred, tgts)
                                   etype,
                                   krb5_kdc_req_sumtype,
                                   cred);
-    krb5_free_cred_contents(&tgt);
+    if (!returning_tgt)
+       krb5_free_cred_contents(&tgt);
 out:
     krb5_free_principal(final_server);
     return retval;