Re: What's cooking in git.git (Oct 2021, #02; Wed, 6)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 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 <peff@xxxxxxxx>
> ---
>  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;
>  }



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux