protobuf-c/protobuf-c.c: fix a logic error when a failed merge would

leave a dangling pointer to the parsed submessage
This commit is contained in:
Ilya Lipnitskiy 2013-11-22 17:35:07 -08:00
parent 7b665e9ce4
commit 746ea972bc

View File

@ -1943,12 +1943,10 @@ parse_required_member (ScannedMember *scanned_member,
merge_successful = merge_messages (*pmessage, subm, allocator);
/* Delete the previous message */
protobuf_c_message_free_unpacked (*pmessage, allocator);
*pmessage = NULL;
}
*pmessage = subm;
if (subm == NULL || !merge_successful)
return 0;
*pmessage = subm;
return 1;
}
}