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

Re: [PATCHv3 5/6] pack-bitmap.c: fix a memleak

From
Jeff King <peff@peff.net>
Date
Mar 31, 2015, 03:32 UTC
Message-ID
<20150331033202.GB842@peff.net>
In-Reply-To
<1427764931-27745-6-git-send-email-sbeller@google.com>
On Mon, Mar 30, 2015 at 06:22:10PM -0700, Stefan Beller wrote:
Show 15 quoted lines
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  pack-bitmap.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/pack-bitmap.c b/pack-bitmap.c
> index 365f9d9..62a98cc 100644
> --- a/pack-bitmap.c
> +++ b/pack-bitmap.c
> @@ -986,6 +986,8 @@ void test_bitmap_walk(struct rev_info *revs)
>  		fprintf(stderr, "OK!\n");
>  	else
>  		fprintf(stderr, "Mismatch!\n");
> +
> +	free(result);

I think this one is fine. I see you dropped the other bits from load_bitmap_entries_v1. There are definitely some leaks there in the error case, and I left some notes in the other thread.

I don't think those leaks are all that critical (we only load the bitmaps one per process, and the memory persists if we succeed, so the worst case is that we spend the memory but do not get to use the bitmaps). But if your goal is making us valgrind-clean, they would certainly count.

-Peff
Previous: Stefan BellerNext: Stefan Beller
Message 12 of 16 in “[PATCHv3 0/6] Memory leaks once again”
  1. Stefan BellerMar 31, 2015
  2. 1/6 shallow: fix a memleakStefan Beller, Mar 31, 2015
  3. Eric SunshineMar 31, 2015
  4. 2/6 line-log.c: fix a memleakStefan Beller, Mar 31, 2015
  5. 3/6 line-log.c: fix a memleakStefan Beller, Mar 31, 2015
  6. Torsten BögershausenMar 31, 2015
  7. Junio C HamanoMar 31, 2015
  8. Stefan BellerMar 31, 2015
  9. Junio C HamanoMar 31, 2015
  10. 4/6 wt-status.c: fix a memleakStefan Beller, Mar 31, 2015
  11. 5/6 pack-bitmap.c: fix a memleakStefan Beller, Mar 31, 2015
  12. Jeff KingMar 31, 2015
  13. 6/6 entry.c: fix a memleakStefan Beller, Mar 31, 2015
  14. Junio C HamanoMar 31, 2015
  15. John KeepingMar 31, 2015
  16. Junio C HamanoMar 31, 2015

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.