libbpf: fix memory leak in attach_tp for target-less tracepoint program
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 16 May 2022 18:45:47 +0000 (11:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 16 May 2022 20:42:44 +0000 (13:42 -0700)
commitac6a65868a5a45db49d5ee8524df3b701110d844
tree72f9343ef2e613411b74f51400d8169d948dbf4a
parent418fbe82578e2889dcc2c0ae4d367ea4e28dd05c
libbpf: fix memory leak in attach_tp for target-less tracepoint program

Fix sec_name memory leak if user defines target-less SEC("tp").

Fixes: 9af8efc45eb1 ("libbpf: Allow "incomplete" basic tracing SEC() definitions")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20220516184547.3204674-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c