LRW module leaks child cipher memory when init_tfm() fails because of child
block size not being 16.

Signed-off-by: Jussi Kivilinna <jussi.kivili...@mbnet.fi>
---
 crypto/lrw.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/crypto/lrw.c b/crypto/lrw.c
index 358f80b..fca3246 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -220,6 +220,7 @@ static int init_tfm(struct crypto_tfm *tfm)
 
        if (crypto_cipher_blocksize(cipher) != 16) {
                *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN;
+               crypto_free_cipher(cipher);
                return -EINVAL;
        }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to