plug some memory leaks
authorJohn Kohl <jtkohl@mit.edu>
Wed, 20 Feb 1991 12:14:47 +0000 (12:14 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Wed, 20 Feb 1991 12:14:47 +0000 (12:14 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1734 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/do_as_req.c
src/kdc/do_tgs_req.c

index 7215c355958035c1e9f52ecb2ce963ee4cef91d5..a5d59b42819b5ea560424b09d649fa74f7dbe4bd 100644 (file)
@@ -358,6 +358,11 @@ krb5_data **response;                      /* filled in with a response packet */
     memset((char *)encrypting_key.contents, 0, encrypting_key.length);
     xfree(encrypting_key.contents);
     cleanup();
+    /* these parts are left on as a courtesy from krb5_encode_kdc_rep so we
+       can use them in raw form if needed.  But, we don't... */
+    memset(reply.enc_part.ciphertext.data, 0,
+          reply.enc_part.ciphertext.length);
+    free(reply.enc_part.ciphertext.data);
     return retval;
 }
 
index 57e79090385261cee5f2f44cd5e0b737a12f848d..66d3b91fca46fa1d5bf960f6511ecb43f5ac1585 100644 (file)
@@ -528,6 +528,14 @@ tgt_again:
     xfree(session_key->contents);
     tkt_cleanup();
     session_key->contents = 0;
+    memset(ticket_reply.enc_part.ciphertext.data, 0,
+          ticket_reply.enc_part.ciphertext.length);
+    free(ticket_reply.enc_part.ciphertext.data);
+    /* these parts are left on as a courtesy from krb5_encode_kdc_rep so we
+       can use them in raw form if needed.  But, we don't... */
+    memset(reply.enc_part.ciphertext.data, 0,
+          reply.enc_part.ciphertext.length);
+    free(reply.enc_part.ciphertext.data);
     return retval;
 }