Apply patch from Arlene Berry to plug a memory leak
authorTom Yu <tlyu@mit.edu>
Tue, 26 Jan 2010 18:43:29 +0000 (18:43 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 26 Jan 2010 18:43:29 +0000 (18:43 +0000)
ticket: 6599
target_version: 1.8
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23672 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/rd_req_dec.c

index 76ecd1583b68732aeada2cdcedb1eac77c6e326b..21728a5279bca815b8ba7334b0d6713ec4441a90 100644 (file)
@@ -114,8 +114,10 @@ rd_req_decrypt_tkt_part(krb5_context context, const krb5_ap_req *req,
 
         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);