diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2011-10-18 06:32:14 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-11-08 22:43:00 -0500 |
commit | b884f8b901b968b90d8d1b82d388583fa1b2605d (patch) | |
tree | a563f7e65847dce4e971aa525b6fd3cd0c787adf /crypto/lrw.c | |
parent | dd6eec242bb2df73743f07535d2bacd6707c6300 (diff) |
crypto: lrw - fix memleak
LRW module leaks child cipher memory when init_tfm() fails because of child
block size not being 16.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/lrw.c')
-rw-r--r-- | crypto/lrw.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c index 358f80be2bf9..fca3246a953f 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c | |||
@@ -220,6 +220,7 @@ static int init_tfm(struct crypto_tfm *tfm) | |||
220 | 220 | ||
221 | if (crypto_cipher_blocksize(cipher) != 16) { | 221 | if (crypto_cipher_blocksize(cipher) != 16) { |
222 | *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; | 222 | *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; |
223 | crypto_free_cipher(cipher); | ||
223 | return -EINVAL; | 224 | return -EINVAL; |
224 | } | 225 | } |
225 | 226 | ||