From: John Kohl Date: Fri, 22 Mar 1991 10:13:18 +0000 (+0000) Subject: don't free/clean up a ticket we're returning X-Git-Tag: krb5-1.0-alpha4~27 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=87cae66ad32889cedfdd8ff4e6c56126b6c5b1dc;p=krb5.git don't free/clean up a ticket we're returning git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1946 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/gc_frm_kdc.c b/src/lib/krb5/krb/gc_frm_kdc.c index 321922ed2..f98f1aa04 100644 --- a/src/lib/krb5/krb/gc_frm_kdc.c +++ b/src/lib/krb5/krb/gc_frm_kdc.c @@ -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;