From e2fb08dbb53ab805f878eaa7d2938d2b2368eb01 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 28 Feb 1996 05:35:06 +0000 Subject: [PATCH] Fix memory leak; free enctypes after use git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7566 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/gc_via_tkt.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 678ea06a9..e14385941 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +Sat Feb 24 16:27:54 1996 Theodore Y. Ts'o + + * gc_via_tkt.c (krb5_get_cred_via_tkt): Fix memory leak; free + enctypes after use. + Thu Jan 25 01:35:52 1996 Sam Hartman * rd_req_dec.c (krb5_rd_req_decrypt_tkt_part): Remove outdated diff --git a/src/lib/krb5/krb/gc_via_tkt.c b/src/lib/krb5/krb/gc_via_tkt.c index cd8a18c8d..0ee919770 100644 --- a/src/lib/krb5/krb/gc_via_tkt.c +++ b/src/lib/krb5/krb/gc_via_tkt.c @@ -111,7 +111,7 @@ krb5_get_cred_via_tkt (context, tkt, kdcoptions, address, in_cred, out_cred) krb5_kdc_rep *dec_rep; krb5_error *err_reply; krb5_response tgsrep; -krb5_enctype *enctypes = 0; + krb5_enctype *enctypes = 0; /* tkt->client must be equal to in_cred->client */ if (!krb5_principal_compare(context, tkt->client, in_cred->client)) @@ -152,12 +152,15 @@ krb5_enctype *enctypes = 0; enctypes[1] = 0; } - if ((retval = krb5_send_tgs(context, kdcoptions, &in_cred->times, enctypes, - in_cred->server, address, in_cred->authdata, - 0, /* no padata */ - (kdcoptions & KDC_OPT_ENC_TKT_IN_SKEY) ? - &in_cred->second_ticket : NULL, - tkt, &tgsrep))) + retval = krb5_send_tgs(context, kdcoptions, &in_cred->times, enctypes, + in_cred->server, address, in_cred->authdata, + 0, /* no padata */ + (kdcoptions & KDC_OPT_ENC_TKT_IN_SKEY) ? + &in_cred->second_ticket : NULL, + tkt, &tgsrep); + if (enctypes) + free(enctypes); + if (retval) return retval; switch (tgsrep.message_type) { -- 2.26.2