From: Greg Hudson Date: Tue, 20 Oct 2009 02:07:22 +0000 (+0000) Subject: Fix memory leaks in enc-perf work X-Git-Tag: krb5-1.8-alpha1~292 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f7a121a63ae3a9496db2b8be4cb4d5f357f38d2;p=krb5.git Fix memory leaks in enc-perf work git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22949 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/builtin/arcfour/arcfour.c b/src/lib/crypto/builtin/arcfour/arcfour.c index 150a7aa06..ad7ccec0b 100644 --- a/src/lib/crypto/builtin/arcfour/arcfour.c +++ b/src/lib/crypto/builtin/arcfour/arcfour.c @@ -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); } diff --git a/src/lib/crypto/krb/key.c b/src/lib/crypto/krb/key.c index 4ea72b478..d6adcba74 100644 --- a/src/lib/crypto/krb/key.c +++ b/src/lib/crypto/krb/key.c @@ -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. */ diff --git a/src/lib/crypto/openssl/arcfour/arcfour.c b/src/lib/crypto/openssl/arcfour/arcfour.c index 2c89b99b8..719bfaabd 100644 --- a/src/lib/crypto/openssl/arcfour/arcfour.c +++ b/src/lib/crypto/openssl/arcfour/arcfour.c @@ -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); }