if (!top.evlist->nr_entries &&
perf_evlist__add_default(top.evlist) < 0) {
ui__error("Not enough memory for event selector list\n");
- return -ENOMEM;
+ goto out_delete_maps;
}
symbol_conf.nr_events = top.evlist->nr_entries;
} else {
ui__error("frequency and count are zero, aborting\n");
status = -EINVAL;
- goto out_delete_evlist;
+ goto out_delete_maps;
}
top.sym_evsel = perf_evlist__first(top.evlist);
status = __cmd_top(&top);
+out_delete_maps:
+ perf_evlist__delete_maps(top.evlist);
out_delete_evlist:
perf_evlist__delete(top.evlist);