mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-13 23:05:27 +00:00
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>
This commit is contained in:
parent
3cd8b687d5
commit
58b0cbea74
@ -45,9 +45,18 @@ git_revpool *gitrp_alloc(git_odb *db)
|
||||
|
||||
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->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);
|
||||
|
||||
free(walk);
|
||||
|
Loading…
Reference in New Issue
Block a user