From patchwork Thu Aug 1 10:40:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13750141 Received: from fhigh2-smtp.messagingengine.com (fhigh2-smtp.messagingengine.com [103.168.172.153]) (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 6B038189910 for ; Thu, 1 Aug 2024 10:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.153 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722508847; cv=none; b=Dwq9YE3GFE594e5NJFgjYiigvNCEsTiLYg0ayADytgvohsrVF4A40nI5yqjVPhwZQ9kcyfftUwc/d3vWmaYclCSs0RUyJzaDkajfvGttLzXshhB/oc5qZAZegU/+dVP0Gcx6pfWFZvujmlim4vwTmXc1pI7wXhgk+gUavoAdW1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722508847; c=relaxed/simple; bh=2bJTOHbTuYlnf6z+SCiVCdJ+6es/vvwIkH5X2+K/YM0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tiKZbmviS9TW4VOSA35PwLPGLcsQLX6soUraAgcSND31IO2r5XuSAom766t650GKxHX9t10csAwIYTl2JbyeW+/FbcHCkFaajv065viiJRzpUawZL5ULCR3U35LOnAgi1Px9wBLGBBjjDQja6Q9WrBgLitakpfaD/ZGbSkf7Ifs= 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=l2wAnavG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=mnNtSrXH; arc=none smtp.client-ip=103.168.172.153 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="l2wAnavG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mnNtSrXH" Received: from compute8.internal (compute8.nyi.internal [10.202.2.227]) by mailfhigh.nyi.internal (Postfix) with ESMTP id BD452114ABD2; Thu, 1 Aug 2024 06:40:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute8.internal (MEProxy); Thu, 01 Aug 2024 06:40:45 -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=fm3; t=1722508845; x=1722595245; bh=xF9m/dypcJ JxDD63UOCwEm1cn6P7L62v+ssoUYQOKvU=; b=l2wAnavGhHolEvLRl7NIgAY5wT huvlCyhqunvlJqscyTRJnSgsktTtGY4ataTDHnoE3hfhQ20/3N4TFxFVxQuf/IDK d8qlXnqO8Gi5msB5cR4W9Y98kMXspWkcZADpZGu/SkMDpZ/vJepMfPXMc91BZZd2 TEQjzgTTnJLgLAa1iqkUUwBXtFk9fWQto7QriYJ2J3IDYHxHu5p+E3cTJ1kBNNFi K2sEbpx36sBXutsapwblJPeTHDN28ZOcovE7oZDugvisWZV7B4ducbppb3uXgcmc IPv0PvxCyG9Xfoiw7d9Xtx7a0HvfwPNVbgl4ZLFrca8eZVNvLq3k/ntAq5Ww== 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= fm3; t=1722508845; x=1722595245; bh=xF9m/dypcJJxDD63UOCwEm1cn6P7 L62v+ssoUYQOKvU=; b=mnNtSrXHt9D6ISOGmE7rEnOPtcICD+hpayGmXyrORT8j Mud2OtpcTto093x+f/DU06VYjjD2SE5Pz3EIopdUA/C+4zgjgPG/1vNUjzdVfe+L D0jJzup2NEr930DNfMcNIMdLlXuuQSC1wm3q8gYGUMqt/jbF+VA04ib3qnxhukOv cYLwnJJRg0qUu/D+e09UsXKZMaRv/W8bmjSP73+dPVtp9nj2mLmwJfA0HSBeGJe+ N6gM3WO3kUSC/RsudvWanyLuQiWcBcCK+YMAXZ65WrhUoX/8J3a83U3eWcVw02IA YXftj1IbDkN0TIQuaYesMoxzC9AnOmn6Ko/m7P9lWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrjeekgdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhmpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Aug 2024 06:40:44 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id 8027a943 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 1 Aug 2024 10:39:12 +0000 (UTC) Date: Thu, 1 Aug 2024 12:40:41 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Karthik Nayak , Taylor Blau , Junio C Hamano , =?utf-8?b?UnViw6lu?= Justo Subject: [PATCH v2 17/24] builtin/shortlog: fix various trivial memory leaks Message-ID: 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: There is a trivial memory leak in git-shortlog(1). Fix it. Signed-off-by: Patrick Steinhardt --- builtin/shortlog.c | 1 + t/t4201-shortlog.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 5bde7c68c2..b529608c92 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -514,4 +514,5 @@ void shortlog_output(struct shortlog *log) string_list_clear(&log->list, 1); clear_mailmap(&log->mailmap); string_list_clear(&log->format, 0); + string_list_clear(&log->trailers, 0); } diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index f698d0c9ad..c20c885724 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -9,6 +9,7 @@ test_description='git shortlog GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_expect_success 'setup' '