diff options
| author | Malaya Kumar Rout <malayarout91@gmail.com> | 2026-07-04 17:59:35 +0530 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-07-07 18:09:20 +0200 |
| commit | 0bebfaa39deadec21638f6fba553eae12627a26d (patch) | |
| tree | ae5254d0990fdc5ae442aa1ea1dd83695fe164cb /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | a58999f9a9ba620593d015981057330de8c56971 (diff) | |
selftests/bpf: Fix memory leak in msg_alloc_iov error path
In msg_alloc_iov(), when calloc() fails for an individual iov_base
allocation, the error path frees all previously allocated iov_base
entries but fails to free the iov array itself that was allocated
with calloc() at the beginning of the function. This results in a
memory leak of the iov array.
Add free(iov) in the unwind_iov error path to ensure proper cleanup
of all allocated memory.
Fixes: 753fb2ee0934 ("bpf: sockmap, add msg_peek tests to test_sockmap")
Signed-off-by: Malaya Kumar Rout <malayarout91@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/bpf/20260704122936.102394-1-malayarout91@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions
