diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 55c11e854fe46..b1ff0c9f32daf 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -1141,8 +1141,10 @@ struct map *dso__new_map(const char *name) struct map *map = NULL; struct dso *dso = dso__new(name); - if (dso) + if (dso) { map = map__new2(0, dso); + dso__put(dso); + } return map; }