libbpf: Fix memory leak in parse_usdt_arg()
authorXu Kuohai <xukuohai@huawei.com>
Tue, 11 Oct 2022 12:01:04 +0000 (08:01 -0400)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 13 Oct 2022 17:53:18 +0000 (10:53 -0700)
commit0dc9254e03704c75f2ebc9cbef2ce4de83fba603
tree9241bdca95d8ad1589961a09e182f3e97a199567
parent93c660ca40b5d2f7c1b1626e955a8e9fa30e0749
libbpf: Fix memory leak in parse_usdt_arg()

In the arm64 version of parse_usdt_arg(), when sscanf returns 2, reg_name
is allocated but not freed. Fix it.

Fixes: 0f8619929c57 ("libbpf: Usdt aarch64 arg parsing support")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/bpf/20221011120108.782373-3-xukuohai@huaweicloud.com
tools/lib/bpf/usdt.c