memory leak in process_tgs_req in r23724
authorTom Yu <tlyu@mit.edu>
Wed, 19 May 2010 21:23:14 +0000 (21:23 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 19 May 2010 21:23:14 +0000 (21:23 +0000)
pull up r23959 from trunk

 ------------------------------------------------------------------------
 r23959 | tlyu | 2010-04-30 17:10:55 -0400 (Fri, 30 Apr 2010) | 8 lines

 ticket: 6711
 subject: memory leak in process_tgs_req in r23724
 tags: pullup
 target_version: 1.8.2

 Fix a KDC memory leak that was introduced by r23724 that could leak
 the decoded request.

ticket: 6728
target_version: 1.7.2
version_fixed: 1.7.2
tags: pullup
status: resolved

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@24066 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/do_tgs_req.c

index 2db5baf4a546ff667e48d092c6dca9ff02fdcc65..2426510cb3f3626c6114f2774d27fd38229aa1f8 100644 (file)
@@ -135,8 +135,10 @@ process_tgs_req(krb5_data *pkt, const krb5_fulladdr *from,
     retval = decode_krb5_tgs_req(pkt, &request);
     if (retval)
         return retval;
-    if (request->msg_type != KRB5_TGS_REQ)
+    if (request->msg_type != KRB5_TGS_REQ) {
+        krb5_free_kdc_req(kdc_context, request);
         return KRB5_BADMSGTYPE;
+    }
 
     /*
      * setup_server_realm() sets up the global realm-specific data pointer.