🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #467

[PATCH v2 05/12] send-pack: plug leak upon match_push_refs failure

#467
From: Jon Simons
Date: Wed, 14 Oct 2026 03:13
24 lines
6057 bytes
Otherwise memory leak tests will flag the missing finish_connect().

Signed-off-by: Jon Simons <jon@jonsimons.org>
---
 builtin/send-pack.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index d6cdbae472..4e6a45ba30 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -311,6 +311,9 @@ int cmd_send_pack(int argc,
 	/* match them up */
 	if (match_push_refs(local_refs, &remote_refs, &rs, flags)) {
 		ret = -1;
+		close(fd[1]);
+		close(fd[0]);
+		finish_connect(conn);
 		goto cleanup;
 	}
 	if (!is_empty_cas(&cas))
-- 
2.55.0
Technical Details
Message-ID: <20261014031347.50433-6-jon@jonsimons.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71922-linux-kernel-git=dewy.ru
References: <20261009192953.81794-1-jon@jonsimons.org> <20261014031347.50433-1-jon@jonsimons.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71922-linux-kernel-git=dewy.ru
From: jon@jonsimons.org (Jon Simons)
Newsgroups: linux.kernel.git
Subject: [PATCH v2 05/12] send-pack: plug leak upon match_push_refs failure
Date: Tue, 13 Oct 2026 23:13:40 -0400
Organization: Usenet Network
Message-ID: <20261014031347.50433-6-jon@jonsimons.org>
References: <20261009192953.81794-1-jon@jonsimons.org>
 <20261014031347.50433-1-jon@jonsimons.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2206985"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:cD3tG0XbtKdk4Nexi5CSm464s5E= sha256:laEVlx2sC6Jul/mQFdwioj/sGPi+w7aimqr858BJtMk=
	sha1:/iv0LoEXnGj7bCDYfGhMxOaUS4c= sha256:Af+Wa9dg7x5f6/hi/VhDgH9WACvboohu6tDbJhvchYU=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 99A1010FFCB; Wed, 14 Oct 2026 06:22:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.949
X-Spam-Status: No, score=-1.949 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=jonsimons.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id fQffcWTFr8Tz;
	Wed, 14 Oct 2026 06:22:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-71922-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=jonsimons.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 1F8C710FFC8; Wed, 14 Oct 2026 06:22:07 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 3D63E3D6C0; Wed, 14 Oct 2026 03:21:52 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FF7E3BBFDE;
	Wed, 14 Oct 2026 03:21:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=jonsimons.org header.i=@jonsimons.org header.b="DGhP2WQ/"
X-Received: from smtp113.iad3a.emailsrvr.com (smtp113.iad3a.emailsrvr.com [173.203.187.113])
	(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 E5981368D5E
	for <git@vger.kernel.org>; Wed, 14 Oct 2026 03:21:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.203.187.113
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791948104; cv=none; b=NxrWQC3Spv56im30KqJVrc4Kf4CBONXfVHVZ+9btR/hNJ9AbO7mwP2C6mAyOVMuQuqt49nv080+MbtbCftM1Wy3982gVHcfDspyTar/Sbh6D3m0Q7S7IwjDiX5VJPNgqnt6VBucyLjePtzZJWGypXE0Mma6nRCfx7TRSHGhSdVQ=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791948104; c=relaxed/simple;
	bh=ZfqFfBHekeaXkZBqMo8KC/f+82rYXgJ+8Q6JGitw1I4=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=rASUeWDbgkiQ6/FzslxSJk1BPqK9xt3+1SvxMBC4+URcUDR0rox17Hexy5+MMSrN/DGbIqortqDujY9U/DaazV3TaXPG1dSCbN9Qx4VwkCkG8VD+NW1RWwRoao69AsVDPnYQeQMF5OeQB/4mJXPdytTwVhd4NnIDosGZaetA6rg=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jonsimons.org; spf=pass smtp.mailfrom=jonsimons.org; dkim=pass (1024-bit key) header.d=jonsimons.org header.i=@jonsimons.org header.b=DGhP2WQ/; arc=none smtp.client-ip=173.203.187.113
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jonsimons.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jonsimons.org
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jonsimons.org;
	s=20200911-u7gnnm7o; t=1791947649;
	bh=ZfqFfBHekeaXkZBqMo8KC/f+82rYXgJ+8Q6JGitw1I4=;
	h=From:To:Subject:Date:From;
	b=DGhP2WQ/2Ky6YKAjfiyRSN6J9uTtAsiKtGVvG3eGl0SaPJtC5y8KvWBwUzI7evwE3
	 7ptT+uDGrPfVNMl92fj5GPnxZ+sYNJbOQi/qX4GZI2sjsFgiUITQB1tPJm8MoqpDEU
	 Xv9lyR4BV+ki7Wg038+s1CDoRFhHB2Mf94lciX0c=
X-Auth-ID: jon@jonsimons.org
X-Received: by smtp23.relay.iad3a.emailsrvr.com (Authenticated sender: jon-AT-jonsimons.org) with ESMTPSA id 8A2F9252F7;
	Tue, 13 Oct 2026 23:14:09 -0400 (EDT)
X-Cc: Jon Simons <jon@jonsimons.org>
X-Mailer: git-send-email 2.55.0
X-In-Reply-To: <20261014031347.50433-1-jon@jonsimons.org>
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-Classification-ID: 20ae8d58-78b7-4215-81c6-d8119c94fa7d-6-1