aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/hists_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/hists_common.c')
-rw-r--r--tools/perf/tests/hists_common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/tests/hists_common.c b/tools/perf/tests/hists_common.c
index 915f60af6a0e..ce80b274b097 100644
--- a/tools/perf/tests/hists_common.c
+++ b/tools/perf/tests/hists_common.c
@@ -134,11 +134,15 @@ struct machine *setup_fake_machine(struct machines *machines)
sym = symbol__new(fsym->start, fsym->length,
STB_GLOBAL, fsym->name);
- if (sym == NULL)
+ if (sym == NULL) {
+ dso__put(dso);
goto out;
+ }
symbols__insert(&dso->symbols[MAP__FUNCTION], sym);
}
+
+ dso__put(dso);
}
return machine;