Skip to content

Commit

Permalink
Fix krb5_rd_req() memory leak
Browse files Browse the repository at this point in the history
In release 1.13, commit eba8c49
(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]

(cherry picked from commit 3aa8506)

ticket: 8239
version_fixed: 1.13.3
status: resolved
  • Loading branch information
nicowilliams authored and tlyu committed Sep 16, 2015
1 parent 5250332 commit 721e80d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/krb5/krb/rd_req_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 721e80d

Please sign in to comment.