]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix memory leak in legacy kprobe attach logic
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 21 Sep 2021 21:00:33 +0000 (14:00 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 22 Sep 2021 02:40:08 +0000 (19:40 -0700)
commitdb7eb42516e10d455a9a40e1031810a77b1de80c
tree69df1a1ac0a8f11d0e62c0fba913d00992446cc4
parent4059c38d6ae6cbcd655df2eab06660a773d73184
libbpf: Fix memory leak in legacy kprobe attach logic

In some error scenarios legacy_probe string won't be free()'d. Fix this.
This was reported by Coverity static analysis.

Fixes: 585af9f2f69a ("libbpf: Introduce legacy kprobe events support")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210921210036.1545557-2-andrii@kernel.org
tools/lib/bpf/libbpf.c