Skip to content

Commit 31e84ed

Browse files
committed
merge: don't try to malloc(0)
1 parent 419ffdd commit 31e84ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/merge.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,8 @@ int git_merge_diff_list__find_renames(
15351535
GIT_ASSERT_ARG(diff_list);
15361536
GIT_ASSERT_ARG(opts);
15371537

1538-
if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0)
1538+
if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0 ||
1539+
!diff_list->conflicts.length)
15391540
return 0;
15401541

15411542
similarity_ours = git__calloc(diff_list->conflicts.length,

0 commit comments

Comments
 (0)