Skip to content
Snippets Groups Projects
Commit 0abb9628 authored by Junio C Hamano's avatar Junio C Hamano
Browse files

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)
parents 2f76ebc9 74373b5f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -238,7 +238,8 @@ void repo_clear(struct repository *repo)
 
if (repo->index) {
discard_index(repo->index);
FREE_AND_NULL(repo->index);
if (repo->index != &the_index)
FREE_AND_NULL(repo->index);
}
}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment