]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix subkey memory leak in krb5_get_credentials
authorGreg Hudson <ghudson@mit.edu>
Fri, 9 Dec 2011 17:57:52 +0000 (17:57 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 9 Dec 2011 17:57:52 +0000 (17:57 +0000)
If a get_credentials operation requires multiple TGS requests, we need
to free the subkey from previous requests before saving a new one.

ticket: 7049
target_version: 1.10
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25536 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/get_creds.c

index b009e6100ba58215f5f2e0a32fcb3af5b7c83ab1..21cb22d1ca4b354569b36dedca2d5138df2240db 100644 (file)
@@ -275,6 +275,8 @@ make_request(krb5_context context, krb5_tkt_creds_context ctx,
     if (code)
         return code;
 
+    krb5_free_keyblock(context, ctx->subkey);
+    ctx->subkey = NULL;
     code = krb5int_make_tgs_request(context, ctx->fast_state,
                                     ctx->cur_tgt, ctx->kdcopt,
                                     ctx->cur_tgt->addresses, NULL,