aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-11 11:19:55 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-11 13:15:05 -0700
commit61f8bb1ec1ef6022c2e7994b8b896ab158d7070b (patch)
treeead48ed7824d24bc1721addcc2d11470be2d584f /builtin/rev-list.c
parentf644dc84949bcc6d6d06274a30feb4b366ae68de (diff)
downloadgit-61f8bb1ec1ef6022c2e7994b8b896ab158d7070b.tar.gz
builtin/rev-list: fix leaking bitmap index when calculating disk usage
git-rev-list(1) can speed up its object size calculations for reachable objects via a bitmap walk, if there is any bitmap. This is done in `try_bitmap_disk_usage()`, which tries to optimistically load the bitmap and then use it, if available. It never frees it though, leading to a memory leak. Fix this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 77803727e0..97d077a994 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -508,6 +508,8 @@ static int try_bitmap_disk_usage(struct rev_info *revs,
size_from_bitmap = get_disk_usage_from_bitmap(bitmap_git, revs);
print_disk_usage(size_from_bitmap);
+
+ free_bitmap_index(bitmap_git);
return 0;
}