Commit 0c56693
ksmbd: Fix memory leak in get_file_all_info()
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: 5614c8c ("ksmbd: replace generic_fillattr with vfs_getattr")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent f8f9c1f commit 0c56693
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4923 | 4923 | | |
4924 | 4924 | | |
4925 | 4925 | | |
4926 | | - | |
| 4926 | + | |
| 4927 | + | |
4927 | 4928 | | |
| 4929 | + | |
4928 | 4930 | | |
4929 | 4931 | | |
4930 | 4932 | | |
| |||
0 commit comments