diff options
author | Li Huafei <[email protected]> | 2024-10-19 23:41:55 +0800 |
---|---|---|
committer | Namhyung Kim <[email protected]> | 2024-10-23 15:35:38 -0700 |
commit | b4e0e9a1e30059f4523c9b6a1f8045ad89b5db8a (patch) | |
tree | 406588225ebeb6df091d103501654b14f29a25f5 | |
parent | 36fae9f93e5f00eb3e410784ce99a4d7503aa12e (diff) |
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 <[email protected]>
Tested-by: Athira Rajeev <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
-rw-r--r-- | tools/perf/util/disasm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index aef06a36bf40..053b1f9ccc71 100644 --- a/tools/perf/util/disasm.c +++ b/tools/perf/util/disasm.c @@ -1720,7 +1720,7 @@ err: */ 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; |