Skip to content

Commit 8c917be

Browse files
committed
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
2 parents e5b7157 + 5f9f7fa commit 8c917be

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

bisect.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ void find_bisection(struct commit_list **commit_list, int *reaches,
442442
best->next = NULL;
443443
}
444444
*reaches = weight(best);
445-
} else {
446-
free_commit_list(*commit_list);
447445
}
448446
*commit_list = best;
449447

t/t6002-rev-list-bisect.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,9 @@ test_expect_success '--bisect-all --first-parent' '
308308
test_cmp expect actual
309309
'
310310

311+
test_expect_success '--bisect without any revisions' '
312+
git rev-list --bisect HEAD..HEAD >out &&
313+
test_must_be_empty out
314+
'
315+
311316
test_done

0 commit comments

Comments
 (0)