diff options
author | Ian Rogers <irogers@google.com> | 2020-05-13 01:59:18 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-05-28 15:03:26 +0200 |
commit | 3efc899d9afb3d03604f191a0be9669eabbfc4aa (patch) | |
tree | 6180e8bfab880b21c75bb980064884d2453ce8ee /tools | |
parent | perf parse-events: Fix incorrect conversion of 'if () free()' to 'zfree()' (diff) | |
download | linux-3efc899d9afb3d03604f191a0be9669eabbfc4aa.tar.xz linux-3efc899d9afb3d03604f191a0be9669eabbfc4aa.zip |
perf evsel: Fix 2 memory leaks
If allocated, perf_pkg_mask and metric_events need freeing.
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200512235918.10732-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index a2397ca4d57a..654b79c1f4ac 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1266,6 +1266,8 @@ void evsel__exit(struct evsel *evsel) zfree(&evsel->group_name); zfree(&evsel->name); zfree(&evsel->pmu_name); + zfree(&evsel->per_pkg_mask); + zfree(&evsel->metric_events); perf_evsel__object.fini(evsel); } |