Commit a0acf60e by panda Committed by Edward Thomson

merge: Check insert_head_ids error in create_virtual_base

insert_head_ids can fail due to allocation error
parent c0358ee1
......@@ -2258,8 +2258,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