Commit dc1095a5 by panda

merge: Check insert_head_ids error in create_virtual_base

insert_head_ids can fail due to allocation error
parent 935f8513
......@@ -2277,8 +2277,11 @@ static int create_virtual_base(
result->type = GIT_ANNOTATED_COMMIT_VIRTUAL;
result->index = index;
insert_head_ids(&result->parents, one);
insert_head_ids(&result->parents, two);
if (insert_head_ids(&result->parents, one) < 0 ||
insert_head_ids(&result->parents, two) < 0) {
git_annotated_commit_free(result);
return -1;
}
*out = result;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment