mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 23:19:28 +00:00
Properly free commit a commit list in revwalk
The commit list was not being properly free'd when a walk was stopped halfway through.
This commit is contained in:
parent
f73b09cd9a
commit
36b3132966
@ -78,13 +78,17 @@ commit_list *commit_list_insert(commit_object *item, commit_list **list_p)
|
|||||||
return new_list;
|
return new_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void commit_list_free(commit_list *list)
|
void commit_list_free(commit_list **list_p)
|
||||||
{
|
{
|
||||||
|
commit_list *list = *list_p;
|
||||||
|
|
||||||
while (list) {
|
while (list) {
|
||||||
commit_list *temp = list;
|
commit_list *temp = list;
|
||||||
list = temp->next;
|
list = temp->next;
|
||||||
free(temp);
|
free(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*list_p = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
commit_object *commit_list_pop(commit_list **stack)
|
commit_object *commit_list_pop(commit_list **stack)
|
||||||
@ -561,9 +565,9 @@ void git_revwalk_reset(git_revwalk *walk)
|
|||||||
);
|
);
|
||||||
|
|
||||||
git_pqueue_free(&walk->iterator_time);
|
git_pqueue_free(&walk->iterator_time);
|
||||||
commit_list_free(walk->iterator_topo);
|
commit_list_free(&walk->iterator_topo);
|
||||||
commit_list_free(walk->iterator_rand);
|
commit_list_free(&walk->iterator_rand);
|
||||||
commit_list_free(walk->iterator_reverse);
|
commit_list_free(&walk->iterator_reverse);
|
||||||
walk->walking = 0;
|
walk->walking = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user