Skip to content

Commit a96015a

Browse files
ttaylorrgitster
authored andcommitted
pack-bitmap: plug leak in find_objects()
The `find_objects()` function creates an object_list for any tips of the reachability query which do not have corresponding bitmaps. The object_list is not used outside of `find_objects()`, but we never free it with `object_list_free()`, resulting in a leak. Let's plug that leak by calling `object_list_free()`, which results in t6113 becoming leak-free. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6cdb67b commit a96015a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pack-bitmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,8 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
12801280
base = fill_in_bitmap(bitmap_git, revs, base, seen);
12811281
}
12821282

1283+
object_list_free(&not_mapped);
1284+
12831285
return base;
12841286
}
12851287

t/t6113-rev-list-bitmap-filters.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ test_description='rev-list combining bitmaps and filters'
44
. ./test-lib.sh
55
. "$TEST_DIRECTORY"/lib-bitmap.sh
66

7+
TEST_PASSES_SANITIZE_LEAK=true
8+
79
test_expect_success 'set up bitmapped repo' '
810
# one commit will have bitmaps, the other will not
911
test_commit one &&

0 commit comments

Comments
 (0)