Commit 4f57a1e
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: b18f3e3 ("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>1 parent 22fe5a2 commit 4f57a1e
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
| |||
1040 | 1043 | | |
1041 | 1044 | | |
1042 | 1045 | | |
1043 | | - | |
| 1046 | + | |
1044 | 1047 | | |
1045 | 1048 | | |
1046 | 1049 | | |
1047 | 1050 | | |
1048 | 1051 | | |
1049 | 1052 | | |
1050 | 1053 | | |
1051 | | - | |
1052 | 1054 | | |
1053 | 1055 | | |
1054 | 1056 | | |
1055 | 1057 | | |
| 1058 | + | |
1056 | 1059 | | |
1057 | 1060 | | |
1058 | 1061 | | |
| |||
0 commit comments