]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add camellia_key_cleanup
authorBen Kaduk <kaduk@mit.edu>
Thu, 22 Nov 2012 02:57:40 +0000 (21:57 -0500)
committerBen Kaduk <kaduk@mit.edu>
Wed, 28 Nov 2012 20:22:42 +0000 (15:22 -0500)
Fix memory leak.

ticket: 7457
tags: pullup
target_version: 1.11

src/lib/crypto/builtin/enc_provider/camellia.c

index 2faf811bf3d30ebedc258d6c0a136639d73e383c..7a0fbd96ef6575495d9c4c39bbf17c207e4c4f50 100644 (file)
@@ -318,6 +318,12 @@ camellia_init_state(const krb5_keyblock *key, krb5_keyusage usage,
     return 0;
 }
 
+static void
+camellia_key_cleanup(krb5_key key)
+{
+    zapfree(key->cache, sizeof(struct camellia_key_info_cache));
+}
+
 const struct krb5_enc_provider krb5int_enc_camellia128 = {
     16,
     16, 16,
@@ -326,6 +332,7 @@ const struct krb5_enc_provider krb5int_enc_camellia128 = {
     krb5int_camellia_cbc_mac,
     camellia_init_state,
     krb5int_default_free_state,
+    camellia_key_cleanup
 };
 
 const struct krb5_enc_provider krb5int_enc_camellia256 = {
@@ -335,5 +342,6 @@ const struct krb5_enc_provider krb5int_enc_camellia256 = {
     krb5int_camellia_decrypt,
     krb5int_camellia_cbc_mac,
     camellia_init_state,
-    krb5int_default_free_state
+    krb5int_default_free_state,
+    camellia_key_cleanup
 };