Merge branch 'nd/repo-clear-keep-the-index'
the_repository->index is not a allocated piece of memory but repo_clear() indiscriminately attempted to free(3) it, which has been corrected. * nd/repo-clear-keep-the-index: repository: fix free problem with repo_clear(the_repository)maint
commit
0abb962893
|
@ -238,7 +238,8 @@ void repo_clear(struct repository *repo)
|
||||||
|
|
||||||
if (repo->index) {
|
if (repo->index) {
|
||||||
discard_index(repo->index);
|
discard_index(repo->index);
|
||||||
FREE_AND_NULL(repo->index);
|
if (repo->index != &the_index)
|
||||||
|
FREE_AND_NULL(repo->index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue