mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-13 19:01:55 +00:00
graph: plug leak
This commit is contained in:
parent
2d6aedbf29
commit
da82043736
@ -22,9 +22,9 @@ static int ahead_behind(git_commit_list_node *one, git_commit_list_node *two,
|
|||||||
if (git_pqueue_init(&pq, 2, git_commit_list_time_cmp) < 0)
|
if (git_pqueue_init(&pq, 2, git_commit_list_time_cmp) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (git_pqueue_insert(&pq, one) < 0)
|
if (git_pqueue_insert(&pq, one) < 0)
|
||||||
return -1;
|
goto on_error;
|
||||||
if (git_pqueue_insert(&pq, two) < 0)
|
if (git_pqueue_insert(&pq, two) < 0)
|
||||||
return -1;
|
goto on_error;
|
||||||
|
|
||||||
while ((commit = git_pqueue_pop(&pq)) != NULL) {
|
while ((commit = git_pqueue_pop(&pq)) != NULL) {
|
||||||
if (commit->flags & RESULT ||
|
if (commit->flags & RESULT ||
|
||||||
@ -43,7 +43,12 @@ static int ahead_behind(git_commit_list_node *one, git_commit_list_node *two,
|
|||||||
commit->flags |= RESULT;
|
commit->flags |= RESULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git_pqueue_free(&pq);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
on_error:
|
||||||
|
git_pqueue_free(&pq);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo,
|
int git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo,
|
||||||
|
Loading…
Reference in New Issue
Block a user