Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jussi Kivilinna and committed by
Herbert Xu
b884f8b9 dd6eec24

+1
+1
crypto/lrw.c
··· 220 220 221 221 if (crypto_cipher_blocksize(cipher) != 16) { 222 222 *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; 223 + crypto_free_cipher(cipher); 223 224 return -EINVAL; 224 225 } 225 226