mirror of
https://github.com/netdata/libbpf.git
synced 2026-11-07 02:10:16 +08:00
libbpf: Potential NULL dereference in usdt_manager_attach_usdt()
link could be null but still dereference bpf_link__destroy(&link->link) and it will lead to a null pointer access. Signed-off-by: Haowen Bai <baihaowen@meizu.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/1649299098-2069-1-git-send-email-baihaowen@meizu.com
This commit is contained in:
1 parent
13fe7fedfa
commit
462e3f600a
1 file changed
+2
-2
+2
-2
@@ -1071,8 +1071,8 @@ struct bpf_link *usdt_manager_attach_usdt(struct usdt_manager *man, const struct
|
||||
return &link->link;
|
||||
|
||||
err_out:
|
||||
bpf_link__destroy(&link->link);
|
||||
|
||||
if (link)
|
||||
bpf_link__destroy(&link->link);
|
||||
free(targets);
|
||||
hashmap__free(specs_hash);
|
||||
if (elf)
|
||||
|
||||
Reference in new issue
Block a user