Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-10-27 00:01:23 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-29 01:32:14 +0300
commit022815114a8a57188bc0e8fd622e10d5e22604dc (patch)
treef40ef7d04ffc33ef7508c5028c6749fe534802e1 /pack-bitmap.c
parent60980aed786487e9113f0cb2907dfc75a77d363c (diff)
pack-bitmap.c: don't leak type-level bitmaps
test_bitmap_walk() is used to implement `git rev-list --test-bitmap`, which compares the result of the on-disk bitmaps with ones generated on-the-fly during a revision walk. In fa95666a40 (pack-bitmap.c: harden 'test_bitmap_walk()' to check type bitmaps, 2021-08-24), we hardened those tests to also check the four special type-level bitmaps, but never freed those bitmaps. We should have, since each required an allocation when we EWAH-decompressed them. Free those, plugging that leak, and also free the base (the scratch-pad bitmap), too. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 3f603425c9..3d81425c29 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -1726,6 +1726,12 @@ void test_bitmap_walk(struct rev_info *revs)
else
die("mismatch in bitmap results");
+ bitmap_free(result);
+ bitmap_free(tdata.base);
+ bitmap_free(tdata.commits);
+ bitmap_free(tdata.trees);
+ bitmap_free(tdata.blobs);
+ bitmap_free(tdata.tags);
free_bitmap_index(bitmap_git);
}