aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/access_variable_array.c
diff options
context:
space:
mode:
authorGeliang Tang <tanggeliang@kylinos.cn>2024-04-29 15:07:33 +0800
committerAndrii Nakryiko <andrii@kernel.org>2024-04-29 16:17:15 -0700
commit237c522c1d5d19e8d3057a38ce690c753020c7d1 (patch)
tree9c1dec9405c26bceeb19a41fb0c09e652455381e /tools/testing/selftests/bpf/prog_tests/access_variable_array.c
parent19468ed51488dae19254e8a67c75d583b05fa5e3 (diff)
selftests/bpf: Free strdup memory in test_sockmap
The strdup() function returns a pointer to a new string which is a duplicate of the string "ptr". Memory for the new string is obtained with malloc(), and need to be freed with free(). This patch adds these missing "free(ptr)" in check_whitelist() and check_blacklist() to avoid memory leaks in test_sockmap.c. Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/b76f2f4c550aebe4ab8ea73d23c4cbe4f06ea996.1714374022.git.tanggeliang@kylinos.cn
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/access_variable_array.c')
0 files changed, 0 insertions, 0 deletions