summaryrefslogtreecommitdiff
path: root/tools/perf/tests/hists_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/hists_output.c')
-rw-r--r--tools/perf/tests/hists_output.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index d8a23db..fd7ec4f 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -71,8 +71,10 @@ static int add_hist_entries(struct hists *hists, struct machine *machine)
goto out;
if (hist_entry_iter__add(&iter, &al, evsel, &sample,
- PERF_MAX_STACK_DEPTH, NULL) < 0)
+ PERF_MAX_STACK_DEPTH, NULL) < 0) {
+ addr_location__put(&al);
goto out;
+ }
fake_samples[i].thread = al.thread;
fake_samples[i].map = al.map;