Patch from Riverbed (Derrick Pallas) under the license of the files they are in:
authorLove Hörnquist Åstrand <lha@kth.se>
Wed, 25 Mar 2009 15:37:42 +0000 (15:37 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Wed, 25 Mar 2009 15:37:42 +0000 (15:37 +0000)
memory leak in krb5_get_creds_opt->ticket

The function krb5_get_creds_opt_set_ticket copies a Ticket
into a krb5_get_cred_opt structure. However,
krb5_get_creds_opt_free does not clean up this Ticket, even
thought he manual pages indicate that it should.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24945 ec53bebd-3082-4978-b11e-865c3cabbd6b

lib/krb5/get_cred.c

index 37caa0cc139b71af60af95030163444bcd8aa60b..3ee6f1b445d8c5135c2c76e45de8ddf9ca8d845b 100644 (file)
@@ -1218,6 +1218,10 @@ krb5_get_creds_opt_free(krb5_context context, krb5_get_creds_opt opt)
 {
     if (opt->self)
        krb5_free_principal(context, opt->self);
+    if (opt->ticket) {
+       free_Ticket(opt->ticket);
+       free(opt->ticket);
+    }
     memset(opt, 0, sizeof(*opt));
     free(opt);
 }