linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] perf disasm: Use disasm_line__free() to properly free disasm_line
@ 2024-10-14 11:42 Li Huafei
  2024-10-14 11:42 ` [PATCH 2/3] " Li Huafei
  2024-10-14 11:42 ` [PATCH 3/3] perf disasm: Fix not cleaning up disasm_line in symbol__disassemble_raw() Li Huafei
  0 siblings, 2 replies; 7+ messages in thread
From: Li Huafei @ 2024-10-14 11:42 UTC (permalink / raw)
  To: atrajeev, namhyung
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, kan.liang, kjain, sesse, linux-perf-users,
	linux-kernel, lihuafei1

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@huawei.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, &notes->src->source, al.node) {
 			list_del(&dl->al.node);
-			free(dl);
+			disasm_line__free(dl);
 		}
 	}
 	count = -1;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-19  7:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14 11:42 [PATCH 1/3] perf disasm: Use disasm_line__free() to properly free disasm_line Li Huafei
2024-10-14 11:42 ` [PATCH 2/3] " Li Huafei
2024-10-15 13:55   ` Athira Rajeev
2024-10-19  7:47     ` Li Huafei
2024-10-14 11:42 ` [PATCH 3/3] perf disasm: Fix not cleaning up disasm_line in symbol__disassemble_raw() Li Huafei
2024-10-17 22:20   ` Namhyung Kim
2024-10-19  2:44     ` Li Huafei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).