OSDN Git Service

Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[tomoyo/tomoyo-test1.git] / crypto / hmac.c
index f03cb32..8b2a212 100644 (file)
@@ -152,8 +152,10 @@ static int hmac_init_tfm(struct crypto_tfm *tfm)
 
        parent->descsize = sizeof(struct shash_desc) +
                           crypto_shash_descsize(hash);
-       if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE))
+       if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) {
+               crypto_free_shash(hash);
                return -EINVAL;
+       }
 
        ctx->hash = hash;
        return 0;