Merge branch 'ps/bisect-double-free-fix'

Work around Coverity warning that would not trigger in practice.

* ps/bisect-double-free-fix:
  bisect: address Coverity warning about potential double free
This commit is contained in:
Junio C Hamano
2024-12-04 10:14:46 +09:00
2 changed files with 5 additions and 2 deletions

View File

@ -442,8 +442,6 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
best->next = NULL;
}
*reaches = weight(best);
} else {
free_commit_list(*commit_list);
}
*commit_list = best;

View File

@ -308,4 +308,9 @@ test_expect_success '--bisect-all --first-parent' '
test_cmp expect actual
'
test_expect_success '--bisect without any revisions' '
git rev-list --bisect HEAD..HEAD >out &&
test_must_be_empty out
'
test_done