selftest/bpf: Fix memory leak in kprobe_multi_test
authorXu Kuohai <xukuohai@huawei.com>
Tue, 11 Oct 2022 12:01:06 +0000 (08:01 -0400)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 13 Oct 2022 17:53:24 +0000 (10:53 -0700)
commit6d2e21dc4db3933db65293552ecc1ede26febeca
tree81782dcbb78352fe71e9a4a6cfb41d73a3952152
parent6e8280b958c5d7edc514cf347a800b23b7732b2b
selftest/bpf: Fix memory leak in kprobe_multi_test

The get_syms() function in kprobe_multi_test.c does not free the string
memory allocated by sscanf correctly. Fix it.

Fixes: 5b6c7e5c4434 ("selftests/bpf: Add attach bench test")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/bpf/20221011120108.782373-5-xukuohai@huaweicloud.com
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c