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)
This commit is contained in:
@@ -238,6 +238,7 @@ void repo_clear(struct repository *repo)
|
|||||||
|
|
||||||
if (repo->index) {
|
if (repo->index) {
|
||||||
discard_index(repo->index);
|
discard_index(repo->index);
|
||||||
|
if (repo->index != &the_index)
|
||||||
FREE_AND_NULL(repo->index);
|
FREE_AND_NULL(repo->index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user