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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
Dec 14, 2023 at 17:23 UTC
a96015a517060e5b69c6dd428f7276f1078ba507
2 files changed
+4
pack-bitmap.c
+2
@@ -1280,6 +1280,8 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
1280
base = fill_in_bitmap(bitmap_git, revs, base, seen);
1281
}
1282
1283
+ object_list_free(¬_mapped);
1284
+
1285
return base;
1286
}
1287
t/t6113-rev-list-bitmap-filters.sh
+2
@@ -4,6 +4,8 @@ test_description='rev-list combining bitmaps and filters'
4
. ./test-lib.sh
5
. "$TEST_DIRECTORY"/lib-bitmap.sh
6
7
+TEST_PASSES_SANITIZE_LEAK=true
8
+
9
test_expect_success 'set up bitmapped repo' '
10
# one commit will have bitmaps, the other will not
11
test_commit one &&