aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c1
-rw-r--r--tools/perf/builtin-stat.c1
-rw-r--r--tools/perf/builtin-top.c1
-rw-r--r--tools/perf/perf.c2
4 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 7069bd3e90b3..aa7ece397656 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -480,6 +480,7 @@ static void atexit_header(void)
480 process_buildids(); 480 process_buildids();
481 perf_header__write(&session->header, output, true); 481 perf_header__write(&session->header, output, true);
482 perf_session__delete(session); 482 perf_session__delete(session);
483 perf_evsel_list__delete();
483 symbol__exit(); 484 symbol__exit();
484 } 485 }
485} 486}
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index c385a63ebfd1..0ff11d9b13be 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -743,6 +743,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
743out_free_fd: 743out_free_fd:
744 list_for_each_entry(pos, &evsel_list, node) 744 list_for_each_entry(pos, &evsel_list, node)
745 perf_evsel__free_stat_priv(pos); 745 perf_evsel__free_stat_priv(pos);
746 perf_evsel_list__delete();
746out: 747out:
747 thread_map__delete(threads); 748 thread_map__delete(threads);
748 threads = NULL; 749 threads = NULL;
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 6ce4042421bd..4b995ee099cf 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1490,6 +1490,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
1490out_free_fd: 1490out_free_fd:
1491 list_for_each_entry(pos, &evsel_list, node) 1491 list_for_each_entry(pos, &evsel_list, node)
1492 perf_evsel__free_mmap(pos); 1492 perf_evsel__free_mmap(pos);
1493 perf_evsel_list__delete();
1493 1494
1494 return status; 1495 return status;
1495} 1496}
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 5b1ecd66bb36..595d0f4a7103 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -286,8 +286,6 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
286 status = p->fn(argc, argv, prefix); 286 status = p->fn(argc, argv, prefix);
287 exit_browser(status); 287 exit_browser(status);
288 288
289 perf_evsel_list__delete();
290
291 if (status) 289 if (status)
292 return status & 0xff; 290 return status & 0xff;
293 291