mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
perf script: Fix metric_evlist leak in script_find_metrics
Fix a memory leak in script_find_metrics() where metric_evlist is leaked
when returning early on error paths.
Assisted-by: Antigravity:gemini-3.1-pro
Fixes: 3622990efa ("perf script: Change metric format to use json metrics")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
bf10e6ee2a
commit
d4171c7740
|
|
@ -2276,8 +2276,8 @@ static int script_find_metrics(const struct pmu_metric *pm,
|
|||
}
|
||||
pr_debug("Found metric '%s' whose evsels match those of in the perf data\n",
|
||||
pm->metric_name);
|
||||
evlist__put(metric_evlist);
|
||||
out:
|
||||
evlist__put(metric_evlist);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user