test_bitmap_walk: free bitmap with bitmap_free
authorJeff King <peff@peff.net>
Fri, 22 May 2015 00:53:36 +0000 (20:53 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 May 2015 16:03:04 +0000 (09:03 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c
index 5e9adc234df93c8dfcf38535f39640f812f0cfe2..3badc2dd1d8b79a907dc7a24a81fe18380206a74 100644 (file)
@@ -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,