mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 22:01:02 +08:00
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:
parent
7b665e9ce4
commit
746ea972bc
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user