diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-top.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 903e4f4a3047..f561757b1bfa 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1164,7 +1164,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1164 | if (!top.evlist->nr_entries && | 1164 | if (!top.evlist->nr_entries && |
1165 | perf_evlist__add_default(top.evlist) < 0) { | 1165 | perf_evlist__add_default(top.evlist) < 0) { |
1166 | ui__error("Not enough memory for event selector list\n"); | 1166 | ui__error("Not enough memory for event selector list\n"); |
1167 | return -ENOMEM; | 1167 | goto out_delete_maps; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | symbol_conf.nr_events = top.evlist->nr_entries; | 1170 | symbol_conf.nr_events = top.evlist->nr_entries; |
@@ -1187,7 +1187,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1187 | } else { | 1187 | } else { |
1188 | ui__error("frequency and count are zero, aborting\n"); | 1188 | ui__error("frequency and count are zero, aborting\n"); |
1189 | status = -EINVAL; | 1189 | status = -EINVAL; |
1190 | goto out_delete_evlist; | 1190 | goto out_delete_maps; |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | top.sym_evsel = perf_evlist__first(top.evlist); | 1193 | top.sym_evsel = perf_evlist__first(top.evlist); |
@@ -1220,6 +1220,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1220 | 1220 | ||
1221 | status = __cmd_top(&top); | 1221 | status = __cmd_top(&top); |
1222 | 1222 | ||
1223 | out_delete_maps: | ||
1224 | perf_evlist__delete_maps(top.evlist); | ||
1223 | out_delete_evlist: | 1225 | out_delete_evlist: |
1224 | perf_evlist__delete(top.evlist); | 1226 | perf_evlist__delete(top.evlist); |
1225 | 1227 | ||