[PATCH v2 0/3] perf tool: Fix multiple memory leakages

From: Zhongqiu Han
Date: Thu Dec 05 2024 - 03:45:52 EST


Fix memory leakages when btf_node or bpf_prog_info_node is duplicated
during insertion into perf_env.

Signed-off-by: Zhongqiu Han <quic_zhonhan@xxxxxxxxxxx>
Reviewed-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
v1 -> v2:
- Following Namhyung's review suggestions, optimize patch 3 by removing
initialization of the return value to true. Instead, use the internal
function's return value directly and add a blank line between the
declaration and other statements.
- Add a blank line before the return statement.
- Following Namhyung's review suggestions, fix the incorrect Fixes tags
for all three patches.
- Link to v1: https://lore.kernel.org/all/20241128125432.2748981-1-quic_zhonhan@xxxxxxxxxxx/

Zhongqiu Han (3):
perf header: Fix one memory leakage in process_bpf_btf()
perf header: Fix one memory leakage in process_bpf_prog_info()
perf bpf: Fix two memory leakages when calling
perf_env__insert_bpf_prog_info()

tools/perf/util/bpf-event.c | 10 ++++++++--
tools/perf/util/env.c | 13 +++++++++----
tools/perf/util/env.h | 4 ++--
tools/perf/util/header.c | 8 ++++++--
4 files changed, 25 insertions(+), 10 deletions(-)


base-commit: bcf2acd8f64b0a5783deeeb5fd70c6163ec5acd7
--
2.25.1