From: Tom Yu Date: Wed, 14 Dec 2011 23:50:41 +0000 (+0000) Subject: pull up r25536 from trunk X-Git-Tag: krb5-1.9.3-final~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1960411d5898b2565a365aa0f3562d2d7af8f047;p=krb5.git pull up r25536 from trunk ------------------------------------------------------------------------ r25536 | ghudson | 2011-12-09 12:57:52 -0500 (Fri, 09 Dec 2011) | 8 lines ticket: 7049 subject: Fix subkey memory leak in krb5_get_credentials target_version: 1.10 tags: pullup If a get_credentials operation requires multiple TGS requests, we need to free the subkey from previous requests before saving a new one. ticket: 7052 version_fixed: 1.9.3 status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-9@25587 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/get_creds.c b/src/lib/krb5/krb/get_creds.c index 450e7d8a3..e81da3500 100644 --- a/src/lib/krb5/krb/get_creds.c +++ b/src/lib/krb5/krb/get_creds.c @@ -273,6 +273,8 @@ make_request(krb5_context context, krb5_tkt_creds_context ctx, if (!krb5_c_valid_enctype(ctx->cur_tgt->keyblock.enctype)) return KRB5_PROG_ETYPE_NOSUPP; + krb5_free_keyblock(context, ctx->subkey); + ctx->subkey = NULL; code = krb5int_make_tgs_request(context, ctx->cur_tgt, ctx->kdcopt, ctx->cur_tgt->addresses, NULL, ctx->tgs_in_creds, NULL, NULL, &request,