From: Ben Kaduk Date: Thu, 22 Nov 2012 02:57:40 +0000 (-0500) Subject: Add camellia_key_cleanup X-Git-Tag: krb5-1.12-alpha1~451 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b37134d163beeeb136b4a59109c523e0bf83f3b;p=thirdparty%2Fkrb5.git Add camellia_key_cleanup Fix memory leak. ticket: 7457 tags: pullup target_version: 1.11 --- diff --git a/src/lib/crypto/builtin/enc_provider/camellia.c b/src/lib/crypto/builtin/enc_provider/camellia.c index 2faf811bf3..7a0fbd96ef 100644 --- a/src/lib/crypto/builtin/enc_provider/camellia.c +++ b/src/lib/crypto/builtin/enc_provider/camellia.c @@ -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 };