Fix memory leak; free enctypes after use
authorTheodore Tso <tytso@mit.edu>
Wed, 28 Feb 1996 05:35:06 +0000 (05:35 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 28 Feb 1996 05:35:06 +0000 (05:35 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7566 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/gc_via_tkt.c

index 678ea06a9464c3befb17168bf29651df948ac65a..e14385941c835b09af5d378d40d0b73c9c99383c 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 24 16:27:54 1996  Theodore Y. Ts'o  <tytso@dcl>
+
+       * gc_via_tkt.c (krb5_get_cred_via_tkt): Fix memory leak; free
+               enctypes after use.
+
 Thu Jan 25 01:35:52 1996  Sam Hartman  <hartmans@tertius.mit.edu>
 
        * rd_req_dec.c (krb5_rd_req_decrypt_tkt_part): Remove outdated
index cd8a18c8d656f22d1e2fe6a284877346c5862310..0ee919770358a2943d9e7221c2a18ebcc8fa599c 100644 (file)
@@ -111,7 +111,7 @@ krb5_get_cred_via_tkt (context, tkt, kdcoptions, address, in_cred, out_cred)
     krb5_kdc_rep *dec_rep;
     krb5_error *err_reply;
     krb5_response tgsrep;
-krb5_enctype *enctypes = 0;
+    krb5_enctype *enctypes = 0;
 
     /* tkt->client must be equal to in_cred->client */
     if (!krb5_principal_compare(context, tkt->client, in_cred->client))
@@ -152,12 +152,15 @@ krb5_enctype *enctypes = 0;
        enctypes[1] = 0;
     }
     
-    if ((retval = krb5_send_tgs(context, kdcoptions, &in_cred->times, enctypes, 
-                               in_cred->server, address, in_cred->authdata,
-                               0,              /* no padata */
-                               (kdcoptions & KDC_OPT_ENC_TKT_IN_SKEY) ? 
-                               &in_cred->second_ticket : NULL,
-                               tkt, &tgsrep)))
+    retval = krb5_send_tgs(context, kdcoptions, &in_cred->times, enctypes, 
+                          in_cred->server, address, in_cred->authdata,
+                          0,           /* no padata */
+                          (kdcoptions & KDC_OPT_ENC_TKT_IN_SKEY) ? 
+                          &in_cred->second_ticket : NULL,
+                          tkt, &tgsrep);
+    if (enctypes)
+       free(enctypes);
+    if (retval)
        return retval;
 
     switch (tgsrep.message_type) {