summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_progs.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-04-29 04:21:04 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-04-29 05:48:05 +0300
commit229bf8bf4d910510bc1a2fd0b89bd467cd71050d (patch)
treecddf013296aff40219e40f654f9c212bd1f070c9 /tools/testing/selftests/bpf/test_progs.c
parent42fce2cfb405e613f0355c4f92429d651bf0a5b3 (diff)
downloadlinux-229bf8bf4d910510bc1a2fd0b89bd467cd71050d.tar.xz
libbpf: Fix memory leak and possible double-free in hashmap__clear
Fix memory leak in hashmap_clear() not freeing hashmap_entry structs for each of the remaining entries. Also NULL-out bucket list to prevent possible double-free between hashmap__clear() and hashmap__free(). Running test_progs-asan flavor clearly showed this problem. Reported-by: Alston Tang <alston64@fb.com> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200429012111.277390-5-andriin@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_progs.c')
0 files changed, 0 insertions, 0 deletions