From: Lidong Yan <502024330056@xxxxxxxxxxxxxxxx> In pack-bitmap.c:find_boundary_objects, we build a roots_bitmap and cascade it to cb.base. Only when cascade failed, roots_bitmap is freed otherwise it leaks. Since cascade_pseudo_merges_1() only use roots_bitmap as a mutable reference not takes roots_bitmap's ownership we'd better remove `if(cascade_pseudo_merges_1)` and frees roots_bitmap anyway. Signed-off-by: Lidong Yan <502024330056@xxxxxxxxxxxxxxxx> --- pack-bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pack-bitmap.c b/pack-bitmap.c index ac6d62b980c5..8727f316de92 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -1363,8 +1363,8 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git, bitmap_set(roots_bitmap, pos); } - if (!cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap)) - bitmap_free(roots_bitmap); + cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap); + bitmap_free(roots_bitmap); } /* -- gitgitgadget