git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2021, 18:02 UTC
Message-ID
<xmqq7deor9v8.fsf@gitster.g>
In-Reply-To
<YV5aaD418SyZqS/1@coredump.intra.peff.net>
Jeff King <peff@peff.net> 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.
Show 27 quoted lines
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  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;
>  }
Previous: Taylor Blau
Message 24 of 24 in “What's cooking in git.git (Oct 2021, #02; Wed, 6)”
  1. Junio C HamanoOct 7, 2021
  2. ab/make-sparse-for-realÆvar Arnfjörð Bjarmason, Oct 7, 2021
  3. Jeff KingOct 7, 2021
  4. Jeff KingOct 7, 2021
  5. Taylor BlauOct 7, 2021
  6. Jeff KingOct 8, 2021
  7. Johannes SchindelinOct 8, 2021
  8. Jeff KingOct 8, 2021
  9. Johannes SchindelinOct 20, 2021
  10. Taylor BlauOct 20, 2021
  11. Junio C HamanoOct 20, 2021
  12. Jeff KingOct 20, 2021
  13. Coverity, was Re: What's cooking in git.git (Oct 2021, #02; Wed, 6)Johannes Schindelin, Aug 16, 2022
  14. Jeff KingAug 17, 2022
  15. Johannes SchindelinAug 19, 2022
  16. Ævar Arnfjörð BjarmasonOct 7, 2021
  17. Jeff KingOct 8, 2021
  18. Junio C HamanoOct 8, 2021
  19. Jeff KingOct 8, 2021
  20. Junio C HamanoOct 8, 2021
  21. Ævar Arnfjörð BjarmasonOct 7, 2021
  22. Taylor BlauOct 7, 2021
  23. Taylor BlauOct 7, 2021
  24. Junio C HamanoOct 7, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.