[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241014114248.212711-1-lihuafei1@huawei.com>
Date: Mon, 14 Oct 2024 19:42:46 +0800
From: Li Huafei <lihuafei1@...wei.com>
To: <atrajeev@...ux.vnet.ibm.com>, <namhyung@...nel.org>
CC: <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
<mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
<jolsa@...nel.org>, <irogers@...gle.com>, <adrian.hunter@...el.com>,
<kan.liang@...ux.intel.com>, <kjain@...ux.ibm.com>, <sesse@...gle.com>,
<linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<lihuafei1@...wei.com>
Subject: [PATCH 1/3] perf disasm: Use disasm_line__free() to properly free disasm_line
The structure disasm_line contains members that require dynamically
allocated memory and need to be freed correctly using
disasm_line__free().
This patch fixes the incorrect release in
symbol__disassemble_capstone().
Fixes: 6d17edc113de ("perf annotate: Use libcapstone to disassemble")
Signed-off-by: Li Huafei <lihuafei1@...wei.com>
---
tools/perf/util/disasm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index f05ba7739c1e..42222d61ceb5 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -1717,7 +1717,7 @@ static int symbol__disassemble_capstone(char *filename, struct symbol *sym,
*/
list_for_each_entry_safe(dl, tmp, ¬es->src->source, al.node) {
list_del(&dl->al.node);
- free(dl);
+ disasm_line__free(dl);
}
}
count = -1;
--
2.25.1
Powered by blists - more mailing lists