Skip to content

Commit

Permalink
Fix leak in krb5_server_decrypt_ticket_keytab()
Browse files Browse the repository at this point in the history
When we skip a keytab entry because it is of the wrong enctype, free
it before continuing.

ticket: 8482
target_version: 1.14-next
target_version: 1.13-next
tags: pullup
  • Loading branch information
Seemant Choudhary authored and greghudson committed Aug 25, 2016
1 parent 15e73c8 commit 9984c23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/krb5/krb/srv_dec_tkt.c
Expand Up @@ -99,8 +99,10 @@ krb5_server_decrypt_ticket_keytab(krb5_context context,
retval = KRB5_KT_NOTFOUND;
while ((code = krb5_kt_next_entry(context, keytab,
&ktent, &cursor)) == 0) {
if (ktent.key.enctype != ticket->enc_part.enctype)
if (ktent.key.enctype != ticket->enc_part.enctype) {
(void) krb5_free_keytab_entry_contents(context, &ktent);
continue;
}

retval = decrypt_ticket_keyblock(context, &ktent.key, ticket);
if (retval == 0) {
Expand Down

0 comments on commit 9984c23

Please sign in to comment.