ubifs: Fix memleak in ubifs_init_authentication
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Tue, 5 Jan 2021 06:03:40 +0000 (14:03 +0800)
committerRichard Weinberger <richard@nod.at>
Fri, 12 Feb 2021 20:53:22 +0000 (21:53 +0100)
commit11b8ab3836454a2600e396f34731e491b661f9d5
tree53a6514323a97fdc5b4e60c9be837193c3e358c2
parent19646447ad3a680d2ab08c097585b7d96a66126b
ubifs: Fix memleak in ubifs_init_authentication

When crypto_shash_digestsize() fails, c->hmac_tfm
has not been freed before returning, which leads
to memleak.

Fixes: 49525e5eecca5 ("ubifs: Add helper functions for authentication support")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/auth.c