From: Li Bin <huawei.li...@huawei.com>

This patch fix potential segment fault triggerd in put_tracepoints_path
when the address of the local variable 'path' be freed in error path
of record_saved_cmdline.

Signed-off-by: Li Bin <huawei.li...@huawei.com>
---
 tools/perf/util/trace-event-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/trace-event-info.c 
b/tools/perf/util/trace-event-info.c
index 086e98ff42a3..0e5c4786f296 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -428,7 +428,7 @@ get_tracepoints_path(struct list_head *pattrs)
                if (!ppath->next) {
 error:
                        pr_debug("No memory to alloc tracepoints list\n");
-                       put_tracepoints_path(&path);
+                       put_tracepoints_path(path.next);
                        return NULL;
                }
 next:
-- 
2.17.1

Reply via email to