selftests/bpf: Fix memory leaks in btf_type_c_dump() helper
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 7 Nov 2021 16:55:15 +0000 (08:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:23 +0000 (11:04 +0100)
commit7ffd2af8085c845f6935fe93768812439ce3b14b
tree9034eb58cb8eb2598533e6a4af2c3bb8d5b9382b
parent9c46c1f1d2acc00151bd92959634fef74641c7e6
selftests/bpf: Fix memory leaks in btf_type_c_dump() helper

[ Upstream commit 8ba285874913da21ca39a46376e9cc5ce0f45f94 ]

Free up memory and resources used by temporary allocated memstream and
btf_dump instance.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-4-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/btf_helpers.c