From: Vinson Lee Date: Sun, 20 Nov 2022 21:53:06 +0000 (-0800) Subject: intel/perf: Fix memory leak. X-Git-Tag: upstream/23.3.3~16507 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86f353ed23d2d59d225d3dd00d350a9fb733e5e3;p=platform%2Fupstream%2Fmesa.git intel/perf: Fix memory leak. Fix defect with Coverity Scan. Resource leak (RESOURCE_LEAK) leaked_storage: Variable pass_array going out of scope leaks the storage it points to. Fixes: d4cbb665067 ("intel/perf: support more than 64 queries") Signed-off-by: Vinson Lee Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/intel/perf/intel_perf.c b/src/intel/perf/intel_perf.c index 0fb89af..cc7e21d 100644 --- a/src/intel/perf/intel_perf.c +++ b/src/intel/perf/intel_perf.c @@ -996,6 +996,8 @@ intel_perf_get_counters_passes(struct intel_perf_config *perf, assert(n_written_passes <= n_passes); } + + free(pass_array); } /* Accumulate 32bits OA counters */