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