Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
repository: fix free problem with repo_clear(the_repository)
[gitweb.git]
/
repository.c
diff --git
a/repository.c
b/repository.c
index bb2fae5446b7ea8d2bfac87faa30c165f714d121..450852d9152ad791a2a63bc938e86061a55d34e2 100644
(file)
--- a/
repository.c
+++ b/
repository.c
@@
-220,7
+220,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);
}
}