Commit 58b0cbea by Vicent Marti

Actually free all commits when freeing a commit pool

Previously the objects table was being freed, but not
the actuall commits. All git_commit objects are freed
and hence invalidated when freeing the git_rp object
they belong to.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
parent 3cd8b687
...@@ -45,9 +45,18 @@ git_revpool *gitrp_alloc(git_odb *db) ...@@ -45,9 +45,18 @@ git_revpool *gitrp_alloc(git_odb *db)
void gitrp_free(git_revpool *walk) void gitrp_free(git_revpool *walk)
{ {
git_commit *commit;
git_revpool_tableit it;
git_commit_list_clear(&(walk->iterator), 0); git_commit_list_clear(&(walk->iterator), 0);
git_commit_list_clear(&(walk->roots), 0); git_commit_list_clear(&(walk->roots), 0);
git_revpool_tableit_init(walk->commits, &it);
while ((commit = (git_commit *)git_revpool_tableit_next(&it)) != NULL) {
free(commit);
}
git_revpool_table_free(walk->commits); git_revpool_table_free(walk->commits);
free(walk); free(walk);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment