perf metricgroup: Missed free on error path

If an out-of-memory occurs the expr also needs freeing.

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
Ian Rogers 2025-10-24 10:58:38 -07:00 committed by Namhyung Kim
parent 5faa23cdab
commit 3bae9228a5

View File

@ -1455,6 +1455,7 @@ static int parse_groups(struct evlist *perf_evlist,
if (!expr->metric_name) {
ret = -ENOMEM;
free(expr);
free(metric_events);
goto out;
}