Files
Wang Yan 0cee720cfd 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: d3d929a8b0 ("LSM: selftests for Linux Security Module syscalls")
Signed-off-by: Wang Yan <[email protected]>
Reviewed-by: William Roberts <[email protected]>
Tested-by: William Roberts <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
2026-07-07 15:14:00 -04:00
..
…
…
…