From patchwork Tue Jun 11 09:21:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13693344 Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (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 EB361176FB6 for ; Tue, 11 Jun 2024 09:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718097668; cv=none; b=PZODM7Flnqh9a1czK2pOfCrAACzGfBJB3STtUzCqR5WJVcNFbfvm39+FB3n9WWIcbDnQVqO1+2OWnKvhQLWbQydXWo2QlqMRdMp7OnbcbYRBPtYNoVZ2kNiKCH5QvTfu19nAN+mAeASI3XVW7r/di4XGNygB9ET7ek+gFmCXWBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718097668; c=relaxed/simple; bh=VGfVvlDUNbpeGIzT+25pAEFkmITqSPqrw2zQPKZ61bw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mOtv7wiHc1b+e5xUq3bI46mBWYAlqPBeIPaP+1FdI3vTBdiUDodVeI50jTJ25dIvKFYMELBHzoycyCSeMcXREfh6qoh2pp7cepgLPLY/EA4+1Ej4P2h5Zb+oiS0MJVYmaE83nUw04s0jz8LRcdX4+TRaNBAthKXcB/y6/Qeyz5g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=BCS/D7Qz; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MdtGYC3e; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="BCS/D7Qz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MdtGYC3e" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 581AB1800071; Tue, 11 Jun 2024 05:21:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 11 Jun 2024 05:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1718097665; x=1718184065; bh=F8RCdAmtal imrsN2lnMf3zLM/H4xK7LmugPTeD2n+2w=; b=BCS/D7QzvwusSbGX5opfN/9rie tabcD7OWxdyKeKqCVHkZKYKqq5nQClNvv2KeIiP3JkW2/CeBtKoxesNC8Ywiq4qA 8C8K9HDfw5wVUd908PA0FoHu5LxZxwAPnrMEeZr6VutvulIVAtyqEqaSGN50oRX8 AHcSEttSyE7+mRKAz2FvR1yvucZuNEM5voKJQWxZ4fuzwMZKn1g34shN0R19NFrP DaYRK37OgdqBjPP09d8mG80gCHxBPgloJ4rM0WW4aGbr1OQmn0uKjSzuAquCtlo5 l3sS6bjsvRsuVCLJKh9Kc9td6MkfKW03GpgzGsnP+16oT7MMCMtpDSFR/sPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1718097665; x=1718184065; bh=F8RCdAmtalimrsN2lnMf3zLM/H4x K7LmugPTeD2n+2w=; b=MdtGYC3eAN0sfKi88bGlbQkBCHKlgUHB9ZMZZt+oEM01 9N4pVLVdz66kFGO13gfDd42tXfXqEmJZefWach7P3Ytkr9YkO/WaW7zc8uYawpNG wJG+u1cNy4+uvNFhz8tNBH9jsjResxa6m8sfmHLU3ZHa8c/rSSz4OXuwmMSNY1KH 2qcHVbDa1kxtXvJu75jItnLuZfiV7SMl/z5o5jO8Trnkwi6MsQngzqsXKxYyBBCy J0+vHDB4bAyImCvOKVDOJ97YqDoYEBKrJi7DrbYjz3bg02WLmo6c86KGocUoJs3/ j9b9bCB2MNREQUNbHwNmBMECnKc3hqdNEdjNWLODTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduvddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Jun 2024 05:21:04 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id 4f778b25 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 11 Jun 2024 09:20:55 +0000 (UTC) Date: Tue, 11 Jun 2024 11:21:01 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Phillip Wood , Karthik Nayak Subject: [PATCH v2 23/29] sequencer: fix memory leaks in `make_script_with_merges()` Message-ID: <1cdd988c4521bd79a1303b6d455cb5a66680e45a.1718095906.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Fix some trivial memory leaks in `make_script_with_merges()`. Signed-off-by: Patrick Steinhardt --- sequencer.c | 3 +++ t/t3418-rebase-continue.sh | 1 + t/t3421-rebase-topology-linear.sh | 2 ++ t/t3434-rebase-i18n.sh | 1 + 4 files changed, 7 insertions(+) diff --git a/sequencer.c b/sequencer.c index c581061b6d..20807ea7e5 100644 --- a/sequencer.c +++ b/sequencer.c @@ -5951,6 +5951,9 @@ static int make_script_with_merges(struct pretty_print_context *pp, strbuf_release(&oneline); strbuf_release(&buf); + oidset_clear(&interesting); + oidset_clear(&child_seen); + oidset_clear(&shown); oidmap_free(&commit2todo, 1); oidmap_free(&state.commit2label, 1); hashmap_clear_and_free(&state.labels, struct labels_entry, entry); diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index 127216f722..c0d29c2154 100755 --- a/t/t3418-rebase-continue.sh +++ b/t/t3418-rebase-continue.sh @@ -5,6 +5,7 @@ test_description='git rebase --continue tests' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh index 62d86d557d..737af80bb3 100755 --- a/t/t3421-rebase-topology-linear.sh +++ b/t/t3421-rebase-topology-linear.sh @@ -1,6 +1,8 @@ #!/bin/sh test_description='basic rebase topology tests' + +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh index a4e482d2cd..26a48d6b10 100755 --- a/t/t3434-rebase-i18n.sh +++ b/t/t3434-rebase-i18n.sh @@ -17,6 +17,7 @@ Initial setup: GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh compare_msg () {