Commit 0de233b9c4f8c83b2cb655bfdbec306c8da81199
1 parent
11859e8217
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
perf top: Delete maps on exit
Removing one more memory leak found with valgrind. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-gnb1gms0k8wictmtm2umpr8u@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
tools/perf/builtin-top.c
... | ... | @@ -1164,7 +1164,7 @@ |
1164 | 1164 | if (!top.evlist->nr_entries && |
1165 | 1165 | perf_evlist__add_default(top.evlist) < 0) { |
1166 | 1166 | ui__error("Not enough memory for event selector list\n"); |
1167 | - return -ENOMEM; | |
1167 | + goto out_delete_maps; | |
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | symbol_conf.nr_events = top.evlist->nr_entries; |
... | ... | @@ -1187,7 +1187,7 @@ |
1187 | 1187 | } else { |
1188 | 1188 | ui__error("frequency and count are zero, aborting\n"); |
1189 | 1189 | status = -EINVAL; |
1190 | - goto out_delete_evlist; | |
1190 | + goto out_delete_maps; | |
1191 | 1191 | } |
1192 | 1192 | |
1193 | 1193 | top.sym_evsel = perf_evlist__first(top.evlist); |
... | ... | @@ -1220,6 +1220,8 @@ |
1220 | 1220 | |
1221 | 1221 | status = __cmd_top(&top); |
1222 | 1222 | |
1223 | +out_delete_maps: | |
1224 | + perf_evlist__delete_maps(top.evlist); | |
1223 | 1225 | out_delete_evlist: |
1224 | 1226 | perf_evlist__delete(top.evlist); |
1225 | 1227 |