diff options
author | Geliang Tang <tanggeliang@kylinos.cn> | 2024-04-29 15:07:34 +0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-04-29 16:17:15 -0700 |
commit | 25927d0a1bec5091d371693c9fdd9640478837de (patch) | |
tree | f4e0204c8bf1d4b7ca95c274c723c5fe18e82bf1 /tools/lib/bpf/libbpf.c | |
parent | 237c522c1d5d19e8d3057a38ce690c753020c7d1 (diff) |
selftests/bpf: Free strdup memory in veristat
The strdup() function returns a pointer to a new string which is a
duplicate of the string "input". Memory for the new string is obtained
with malloc(), and need to be freed with free().
This patch adds these missing "free(input)" in parse_stats() to avoid
memory leak in veristat.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/ded44f8865cd7f337f52fc5fb0a5fbed7d6bd641.1714374022.git.tanggeliang@kylinos.cn
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
0 files changed, 0 insertions, 0 deletions