Browse Source

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
Junio C Hamano 7 years ago
parent
commit
0abb962893
  1. 3
      repository.c

3
repository.c

@ -238,7 +238,8 @@ void repo_clear(struct repository *repo) @@ -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…
Cancel
Save