]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
perf metric: Fix some memory leaks
authorNamhyung Kim <namhyung@kernel.org>
Tue, 15 Sep 2020 03:18:09 +0000 (12:18 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 15 Sep 2020 11:58:03 +0000 (08:58 -0300)
commit4f57a1ed749a81ec553d89233cab53db9365e193
tree7f6aa7063c0406600b1044b03f0e0607e052ce68
parent22fe5a25b5d8c4f8008dc4a8738d6d8a5f5ddbe9
perf metric: Fix some memory leaks

I found some memory leaks while reading the metric code.  Some are real
and others only occur in the error path.  When it failed during metric
or event parsing, it should release all resources properly.

Fixes: b18f3e365019d ("perf stat: Support JSON metrics in perf stat")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200915031819.386559-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/metricgroup.c