Fix memory leaks in enc-perf work
authorGreg Hudson <ghudson@mit.edu>
Tue, 20 Oct 2009 02:07:22 +0000 (02:07 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 20 Oct 2009 02:07:22 +0000 (02:07 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22949 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/builtin/arcfour/arcfour.c
src/lib/crypto/krb/key.c
src/lib/crypto/openssl/arcfour/arcfour.c

index 150a7aa0675df1882c89749d341b3d03de54266e..ad7ccec0b5fc005386eeb530ae79a656a13485ce 100644 (file)
@@ -186,6 +186,7 @@ krb5_arcfour_encrypt(const struct krb5_enc_provider *enc,
   free(d3.data);
   free(salt.data);
   free(plaintext.data);
+  krb5_k_free_key(NULL, k3key);
   return (ret);
 }
 
index 4ea72b478f02fa5df3c54967a9642bf2d1de7b98..d6adcba741574960441f13b0e9b5c26465dd4365 100644 (file)
@@ -77,10 +77,12 @@ krb5_k_free_key(krb5_context context, krb5_key key)
     /* Free the derived key cache. */
     while ((dk = key->derived) != NULL) {
        key->derived = dk->next;
+       free(dk->constant.data);
        krb5_k_free_key(context, dk->dkey);
        free(dk);
     }
     krb5int_c_free_keyblock_contents(context, &key->keyblock);
+    free(key);
 }
 
 /* Retrieve a copy of the keyblock from a krb5_key. */
index 2c89b99b827059774f0835b7c58992d190ba388f..719bfaabdfdb79059f5b2295defa65e1d14a6f46 100644 (file)
@@ -187,6 +187,7 @@ krb5_arcfour_encrypt(const struct krb5_enc_provider *enc,
   free(d3.data);
   free(salt.data);
   free(plaintext.data);
+  krb5_k_free_key(NULL, k3key);
   return (ret);
 }