[krbdev.mit.edu #6599] memory leak in krb5_rd_req_decrypt_tkt_part

Arlene Berry via RT rt-comment at krbdev.mit.edu
Tue Dec 22 18:05:01 EST 2009


I'm seeing a leak in krb5_rd_req_decrpt_tkt_part while iterating over
the keytab.  This fixes it for us:

Index: rd_req_dec.c
===================================================================
--- rd_req_dec.c	(revision 23482)
+++ rd_req_dec.c	(working copy)
@@ -114,8 +114,10 @@
 
         while ((code = krb5_kt_next_entry(context, keytab,
                                           &ktent, &cursor)) == 0) {
-            if (ktent.key.enctype != req->ticket->enc_part.enctype)
+            if (ktent.key.enctype != req->ticket->enc_part.enctype) {
+                (void) krb5_free_keytab_entry_contents(context,
&ktent);
                 continue;
+            }
 
             retval = krb5_decrypt_tkt_part(context, &ktent.key,
                                            req->ticket);





More information about the krb5-bugs mailing list