repository: Properly free the index on close

This commit is contained in:
Vicent Marti 2011-05-17 14:51:42 +03:00
parent 62845c903e
commit b3d94069b4

View File

@ -315,8 +315,10 @@ void git_repository_free(git_repository *repo)
if (repo->db != NULL)
git_odb_close(repo->db);
if (repo->index != NULL)
if (repo->index != NULL) {
repo->index->repository = NULL;
git_index_free(repo->index);
}
free(repo);
}