mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2025-01-14 01:07:57 +08:00
protobuf-c: parse_required_member(): Remove duplicate NULL check
`*pstr != NULL` was already checked here. See https://github.com/protobuf-c/protobuf-c/issues/517.
This commit is contained in:
parent
0ce231b16d
commit
bee044643e
@ -2557,7 +2557,7 @@ parse_required_member(ScannedMember *scanned_member,
|
|||||||
|
|
||||||
if (maybe_clear && *pstr != NULL) {
|
if (maybe_clear && *pstr != NULL) {
|
||||||
const char *def = scanned_member->field->default_value;
|
const char *def = scanned_member->field->default_value;
|
||||||
if (*pstr != NULL && *pstr != def)
|
if (*pstr != def)
|
||||||
do_free(allocator, *pstr);
|
do_free(allocator, *pstr);
|
||||||
}
|
}
|
||||||
*pstr = do_alloc(allocator, len - pref_len + 1);
|
*pstr = do_alloc(allocator, len - pref_len + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user