From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9B08C433F5 for ; Thu, 7 Oct 2021 18:02:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D90F60FC3 for ; Thu, 7 Oct 2021 18:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243451AbhJGSEv (ORCPT ); Thu, 7 Oct 2021 14:04:51 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:59119 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbhJGSEv (ORCPT ); Thu, 7 Oct 2021 14:04:51 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 23139141F88; Thu, 7 Oct 2021 14:02:57 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=cAuHe5J7Zh9J0RXOvVxYMqz4ybzfxK/cg2eCUs HRPL0=; b=RmXjKUF3VjlDFNyP9Dx97cQlf9FxSrGOLW7MWtWlDITahftGwneRho PeljGpDgjUtlNVOCtQx3mONiTZXhaccx0iQZ0D43CLDvXrbWnNinNZNBrtCjDdoa 42VW1gM5jRbeqIyCD7LYhZKQm0mzfPboXyGSyuEfPTJXdvQG1M5hQ= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 1B553141F87; Thu, 7 Oct 2021 14:02:57 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.133.2.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 1DA1D141F86; Thu, 7 Oct 2021 14:02:53 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Taylor Blau , git@vger.kernel.org Subject: Re: What's cooking in git.git (Oct 2021, #02; Wed, 6) References: Date: Thu, 07 Oct 2021 11:02:51 -0700 In-Reply-To: (Jeff King's message of "Wed, 6 Oct 2021 22:24:40 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: CABA79E4-2798-11EC-8A83-F327CE9DA9D6-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > In read_midx_preferred_pack(), we open the bitmap index but never free > it. This isn't a big deal since this is just a test helper, and we exit > immediately after, but since we're trying to keep our leak-checking tidy > now, it's worth fixing. Thanks. That sounds sensible. > > Signed-off-by: Jeff King > --- > t/helper/test-read-midx.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c > index 0038559129..9d6fa7a377 100644 > --- a/t/helper/test-read-midx.c > +++ b/t/helper/test-read-midx.c > @@ -85,11 +85,15 @@ static int read_midx_preferred_pack(const char *object_dir) > return 1; > > bitmap = prepare_bitmap_git(the_repository); > - if (!(bitmap && bitmap_is_midx(bitmap))) > + if (!bitmap) > return 1; > - > + if (!bitmap_is_midx(bitmap)) { > + free_bitmap_index(bitmap); > + return 1; > + } > > printf("%s\n", midx->pack_names[midx_preferred_pack(bitmap)]); > + free_bitmap_index(bitmap); > return 0; > }