linux-stable/tools/bpf/bpftool
Miaoqian Lin fa55ef14ef bpftool: Fix memory leak in do_build_table_cb
strdup() allocates memory for path. We need to release the memory in the
following error path. Add free() to avoid memory leak.

Fixes: 8f184732b6 ("bpftool: Switch to libbpf's hashmap for pinned paths of BPF objects")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20221206071906.806384-1-linmq006@gmail.com
2022-12-06 21:20:42 +01:00
..
Documentation bpftool: remove support of --legacy option for bpftool 2022-11-20 16:17:46 -08:00
bash-completion bpftool: remove support of --legacy option for bpftool 2022-11-20 16:17:46 -08:00
skeleton bpftool: Add bpf_cookie to link output 2022-03-15 15:07:27 -07:00
.gitignore bpftool: Fix SPDX tag for Makefiles and .gitignore 2021-11-10 09:00:52 -08:00
Makefile bpftool: Add LLVM as default library for disassembling JIT-ed programs 2022-10-25 10:11:56 -07:00
btf.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
btf_dumper.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
cfg.c tools, bpftool: Poison and replace kernel integer typedefs 2020-05-11 21:20:46 +02:00
cfg.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cgroup.c bpftool: Fix wrong cgroup attach flags being assigned to effective progs 2022-09-21 10:57:12 -07:00
common.c bpftool: Fix memory leak in do_build_table_cb 2022-12-06 21:20:42 +01:00
feature.c bpftool: Fix a typo in a comment 2022-08-15 17:29:42 +02:00
gen.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
iter.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
jit_disasm.c bpftool: Fix spelling mistake "disasembler" -> "disassembler" 2022-10-26 18:20:22 -07:00
json_writer.c bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
json_writer.h bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
link.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
main.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
main.h bpftool: remove support of --legacy option for bpftool 2022-11-20 16:17:46 -08:00
map.c bpftool: remove function free_btf_vmlinux() 2022-11-20 16:17:46 -08:00
map_perf_ring.c bpftool: Fix error message of strerror 2022-09-30 15:40:46 -07:00
net.c bpftool: Define _GNU_SOURCE only once 2022-10-25 10:11:56 -07:00
netlink_dumper.c bpftool: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
netlink_dumper.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
perf.c bpftool: Define _GNU_SOURCE only once 2022-10-25 10:11:56 -07:00
pids.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
prog.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
struct_ops.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
tracelog.c bpftool, musl compat: Replace sys/fcntl.h by fcntl.h 2022-04-25 23:24:28 +02:00
xlated_dumper.c bpftool: Define _GNU_SOURCE only once 2022-10-25 10:11:56 -07:00
xlated_dumper.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00