]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix krb5_rd_req() memory leak
authorNicolas Williams <nico@twosigma.com>
Tue, 1 Sep 2015 15:58:30 +0000 (11:58 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 14 Sep 2015 23:54:44 +0000 (19:54 -0400)
In release 1.13, commit eba8c4909ec7ba0d7054d5d1b1061319e9970cc7
(ticket #7232) introduced a memory leak when skipping keytab entries
which do not match the application-provided server specification.  Fix
it by freeing the keytab entry before continuing the loop on a failure
to match.

[ghudson@mit.edu: commit message]

ticket: 8239 (new)
target_version: 1.13.3
tags: pullup

src/lib/krb5/krb/rd_req_dec.c

index df5ba7a35abc6a70d2208e2bd5a2dbc2e1dc19db..6defbdbf019da469415766829d87433948986345 100644 (file)
@@ -396,6 +396,7 @@ decrypt_ticket(krb5_context context, const krb5_ap_req *req,
         if (!krb5_sname_match(context, server, ent.principal)) {
             if (krb5_principal_compare(context, ent.principal, tkt_server))
                 tkt_server_mismatch = TRUE;
+            (void)krb5_free_keytab_entry_contents(context, &ent);
             continue;
         }
         found_server_match = TRUE;