From: Ian Rogers Date: Fri, 24 Oct 2025 17:58:38 +0000 (-0700) Subject: perf metricgroup: Missed free on error path X-Git-Tag: v6.19-rc1~61^2~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bae9228a5503f7fb6464e895c3f542221ce9395;p=thirdparty%2Fkernel%2Flinux.git perf metricgroup: Missed free on error path If an out-of-memory occurs the expr also needs freeing. Signed-off-by: Ian Rogers Signed-off-by: Namhyung Kim --- diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 595b83142d2cc..c822cf5da53b3 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -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; }