* [PATCH] test_bitmap_walk: free bitmap with bitmap_free
@ 2015-05-22 0:53 Jeff King
2015-05-22 16:37 ` Stefan Beller
0 siblings, 1 reply; 2+ messages in thread
From: Jeff King @ 2015-05-22 0:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Stefan Beller, git
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.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] test_bitmap_walk: free bitmap with bitmap_free
2015-05-22 0:53 [PATCH] test_bitmap_walk: free bitmap with bitmap_free Jeff King
@ 2015-05-22 16:37 ` Stefan Beller
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Beller @ 2015-05-22 16:37 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, git
On Thu, May 21, 2015 at 5:53 PM, Jeff King <peff@peff.net> wrote:
> 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.
>
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-22 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-22 0:53 [PATCH] test_bitmap_walk: free bitmap with bitmap_free Jeff King
2015-05-22 16:37 ` Stefan Beller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.