Commit facf22c1 authored by Wang Zhaolong's avatar Wang Zhaolong Committed by Greg Kroah-Hartman
Browse files

ksmbd: fix memory leak in parse_lease_state()



[ Upstream commit eb4447bc ]

The previous patch that added bounds check for create lease context
introduced a memory leak. When the bounds check fails, the function
returns NULL without freeing the previously allocated lease_ctx_info
structure.

This patch fixes the issue by adding kfree(lreq) before returning NULL
in both boundary check cases.

Fixes: bab703ed ("ksmbd: add bounds check for create lease context")
Signed-off-by: default avatarWang Zhaolong <wangzhaolong1@huawei.com>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent bca8df99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment