Merge branch 'ps/free-island-marks'
Fix on a previous fix already in 'master'. * ps/free-island-marks: delta-islands: fix segfault when freeing island marks
This commit is contained in:
@ -517,11 +517,13 @@ void free_island_marks(void)
|
|||||||
{
|
{
|
||||||
struct island_bitmap *bitmap;
|
struct island_bitmap *bitmap;
|
||||||
|
|
||||||
kh_foreach_value(island_marks, bitmap, {
|
if (island_marks) {
|
||||||
if (!--bitmap->refcount)
|
kh_foreach_value(island_marks, bitmap, {
|
||||||
free(bitmap);
|
if (!--bitmap->refcount)
|
||||||
});
|
free(bitmap);
|
||||||
kh_destroy_oid_map(island_marks);
|
});
|
||||||
|
kh_destroy_oid_map(island_marks);
|
||||||
|
}
|
||||||
|
|
||||||
/* detect use-after-free with a an address which is never valid: */
|
/* detect use-after-free with a an address which is never valid: */
|
||||||
island_marks = (void *)-1;
|
island_marks = (void *)-1;
|
||||||
|
@ -1015,4 +1015,20 @@ test_expect_success 'complains when run outside of a repository' '
|
|||||||
grep "not a git repository" err
|
grep "not a git repository" err
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'repack with delta islands' '
|
||||||
|
git init repo &&
|
||||||
|
test_when_finished "rm -fr repo" &&
|
||||||
|
(
|
||||||
|
cd repo &&
|
||||||
|
|
||||||
|
test_commit first &&
|
||||||
|
git repack &&
|
||||||
|
test_commit second &&
|
||||||
|
git repack &&
|
||||||
|
|
||||||
|
git multi-pack-index write &&
|
||||||
|
git -c repack.useDeltaIslands=true multi-pack-index repack
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Reference in New Issue
Block a user