diff options
| author | Wang Yan <wangyan01@kylinos.cn> | 2026-07-03 20:09:51 +0800 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2026-07-07 15:14:00 -0400 |
| commit | 0cee720cfd51402cfcb14d96cb326a36c13b823a (patch) | |
| tree | 4f496a4fd4d39ce8f4fc518b274117a2de709286 /include/linux/ism.h | |
| parent | 15c1f17979712407a4a71f2129f89ecd625ccbe8 (diff) | |
| download | linux-next-0cee720cfd51402cfcb14d96cb326a36c13b823a.tar.gz linux-next-0cee720cfd51402cfcb14d96cb326a36c13b823a.zip | |
selftests/lsm: Fix memory leak in attr_lsm_count
The calloc-allocated buffer in attr_lsm_count() is never released on
any exit path, including both the normal return path and the early
return when read_sysfs_lsms fails, resulting in a heap memory leak.
Add free() for the buffer on all return branches to fix the leak.
Fixes: d3d929a8b0cd ("LSM: selftests for Linux Security Module syscalls")
Signed-off-by: Wang Yan <wangyan01@kylinos.cn>
Reviewed-by: William Roberts <bill.c.roberts@gmail.com>
Tested-by: William Roberts <bill.c.roberts@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include/linux/ism.h')
0 files changed, 0 insertions, 0 deletions
