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( ...@@ -2277,8 +2277,11 @@ static int create_virtual_base(
result->type = GIT_ANNOTATED_COMMIT_VIRTUAL; result->type = GIT_ANNOTATED_COMMIT_VIRTUAL;
result->index = index; result->index = index;
insert_head_ids(&result->parents, one); if (insert_head_ids(&result->parents, one) < 0 ||
insert_head_ids(&result->parents, two); insert_head_ids(&result->parents, two) < 0) {
git_annotated_commit_free(result);
return -1;
}
*out = result; *out = result;
return 0; 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