diff --git a/protobuf-c/protobuf-c.c b/protobuf-c/protobuf-c.c index 1519c37..8f7c12a 100644 --- a/protobuf-c/protobuf-c.c +++ b/protobuf-c/protobuf-c.c @@ -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; } }