Commit f60efb44 authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

perf hist: In init, ensure mem_info is put on error paths



Rather than exit the internal map_symbols directly, put the mem-info
that does this and also lowers the reference count on the mem-info
itself otherwise the mem-info is being leaked.

Fixes: 56e144fe ("perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit")
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Reviewed-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent dc4d1654
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -608,10 +608,8 @@ static int hist_entry__init(struct hist_entry *he,
		map_symbol__exit(&he->branch_info->to.ms);
		zfree(&he->branch_info);
	}
	if (he->mem_info) {
		map_symbol__exit(&mem_info__iaddr(he->mem_info)->ms);
		map_symbol__exit(&mem_info__daddr(he->mem_info)->ms);
	}
	if (he->mem_info)
		mem_info__zput(he->mem_info);
err:
	map_symbol__exit(&he->ms);
	zfree(&he->stat_acc);