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

Re: [PATCH] test_bitmap_walk: free bitmap with bitmap_free

From
Stefan Beller <sbeller@google.com>
Date
May 22, 2015, 16:37 UTC
Message-ID
<CAGZ79kZqRE78qFGPcU9xiFDiGG3X0kaBFdH+rGhUCZBM3ikUDA@mail.gmail.com>
In-Reply-To
<20150522005336.GA26326@peff.net>
On Thu, May 21, 2015 at 5:53 PM, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
> noticed that we leak the "result" bitmap. But we should use
> "bitmap_free" rather than straight "free", as the former
> remembers to free the bitmap array pointed to by the struct.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Sorry, I should have noticed this when reviewing the original.

No need to be sorry, me too. This looks good to me.

Show 19 quoted lines
>
>  pack-bitmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pack-bitmap.c b/pack-bitmap.c
> index 62a98cc..d64bd94 100644
> --- a/pack-bitmap.c
> +++ b/pack-bitmap.c
> @@ -987,7 +987,7 @@ void test_bitmap_walk(struct rev_info *revs)
>         else
>                 fprintf(stderr, "Mismatch!\n");
>
> -       free(result);
> +       bitmap_free(result);
>  }
>
>  static int rebuild_bitmap(uint32_t *reposition,
> --
> 2.4.1.528.g00591e3
Previous: Jeff King
Message 2 of 2 in “test_bitmap_walk: free bitmap with bitmap_free”
  1. test_bitmap_walk: free bitmap with bitmap_freeJeff King, May 22, 2015
  2. Stefan BellerMay 22, 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.