From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FEDD3C1414; Tue, 16 Jun 2026 02:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781576866; cv=none; b=AYmHd9KPlbWEGvBa5sXfmYXQgs+HqncmTcUc+2Qcqdiz2HbSInyFDXfkQF+CLNeysoNSfONzbc+DMgYUaZ/DuZOvkABqgA2GvKFvIb/sEqaq6HEkoRb1ROLeoW3wgQnxujNu99Qn3i8Kn2YDpcC8jPyu3hZDLoKzWHJqFJhoWME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781576866; c=relaxed/simple; bh=iZcqG58TA5LGQvJYby9/qaw07A039ETs3uwWOc5UV8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bjp+qeza15OSIDrHjqYFqYeN6NmAmr4hlzqcRrDYOugGtfThhqQEmhVqkx1vzsm/gOgDseoOswGPTxrm5eMHDIbdfpqv0yffzDt9y5DBeuMq4JeQwVXWRlE/lFiVaHjfIKbu1NA2kZiYKruKT8e/bB3Vz+LPc+zegq4K1YyWwfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hhIk2Xaf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hhIk2Xaf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF8061F000E9; Tue, 16 Jun 2026 02:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781576864; bh=kgJYoHlcqFV+eugqlEuDQnuZ+mPxNa7dqap9zdwn9z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hhIk2Xaf67Vdrmshp9Wf2o13iQiehDC/N0FzKiG7v66jnNET8Tj/zqW6Brk7Eepm4 7ewNFbXA+g4I2NWlllE5H/SB215dmvfeIHz/qIN+LjVEoqEKqkIoohsO3VqMx3xB8s QKx/w8EE12J2kW9l0WuRzPd+zpbldkD6VfqtmUt/Zpu1ABCgqF2z85vFleptO/proD TOrfQWOXNdAY1yrbMuDyrUbM3OamS6wJhXxIrsN6rhp0VxfLxOQcKV+Jq5vt3Sq4QD 5zkkKuwTUujy7M+DIfEfJnUQjO+Voj2Ft3b3xjmVlqH9owi2dGbZWUpOOM1enna60K IXml+KHJNP70w== From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , James Clark , Jiri Olsa , Ian Rogers , Adrian Hunter , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , sashiko-bot , Claude Subject: [PATCH 6/9] perf c2c: Free format list entries when c2c_hists__init() fails Date: Mon, 15 Jun 2026 23:27:12 -0300 Message-ID: <20260616022715.5739-7-acme@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616022715.5739-1-acme@kernel.org> References: <20260616022715.5739-1-acme@kernel.org> Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnaldo Carvalho de Melo When c2c_hists__init() fails partway through hpp_list__parse(), dynamically allocated format structures that were already added to hists->list are leaked because he__get_c2c_hists() frees the hists container without first unregistering the format entries. Call perf_hpp__reset_output_field() before freeing the hists container on the error path, matching what c2c_he_free() already does on the normal destruction path. Fixes: 17a7c5946d79a12c ("perf c2c report: Decode c2c_stats for hist entries") Reported-by: sashiko-bot Cc: Jiri Olsa Assisted-by: Claude Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 07c7e8fb315e6cf3..eabb922ef295ef86 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -226,6 +226,7 @@ he__get_c2c_hists(struct hist_entry *he, ret = c2c_hists__init(hists, sort, nr_header_lines, env); if (ret) { + perf_hpp__reset_output_field(&hists->list); c2c_he->hists = NULL; free(hists); return NULL; -- 2.54.0