Re: [PATCH] ksmbd: Fix memory leak in get_file_all_info()
From: Namjae Jeon
Date: Wed Dec 24 2025 - 21:00:16 EST
On Wed, Dec 24, 2025 at 11:20 PM Zilin Guan <zilin@xxxxxxxxxx> wrote:
>
> In get_file_all_info(), if vfs_getattr() fails, the function returns
> immediately without freeing the allocated filename, leading to a memory
> leak.
>
> Fix this by freeing the filename before returning in this error case.
>
> Fixes: 5614c8c487f6a ("ksmbd: replace generic_fillattr with vfs_getattr")
> Signed-off-by: Zilin Guan <zilin@xxxxxxxxxx>
Applied it to #ksmbd-for-next-next.
Thanks!