From 87cae66ad32889cedfdd8ff4e6c56126b6c5b1dc Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 22 Mar 1991 10:13:18 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/gc_frm_kdc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.26.2