Skip to content

Commit

Permalink
crypto: lrw - fix memleak
Browse files Browse the repository at this point in the history
LRW module leaks child cipher memory when init_tfm() fails because of child
block size not being 16.

Signed-off-by: Jussi Kivilinna <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
jkivilin authored and herbertx committed Nov 9, 2011
1 parent dd6eec2 commit b884f8b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b884f8b

Please sign in to comment.