Skip to content

Commit 249b101

Browse files
brandb97gitster
authored andcommitted
pack-bitmap: remove checks before bitmap_free
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fcfe606 commit 249b101

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pack-bitmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,8 +1363,8 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
13631363
bitmap_set(roots_bitmap, pos);
13641364
}
13651365

1366-
if (!cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap))
1367-
bitmap_free(roots_bitmap);
1366+
cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap);
1367+
bitmap_free(roots_bitmap);
13681368
}
13691369

13701370
/*

0 commit comments

Comments
 (0)