mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-31 00:13:00 +08:00
Fix memory leak when used with uknown fields.
git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@91 00440858-1255-0410-a3e6-75ea37f81c3a
This commit is contained in:
parent
1cbc75c122
commit
2650c6744a
@ -1592,6 +1592,12 @@ protobuf_c_message_free_unpacked (ProtobufCMessage *message,
|
|||||||
protobuf_c_message_free_unpacked (sm, allocator);
|
protobuf_c_message_free_unpacked (sm, allocator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (f = 0; f < message->n_unknown_fields; f++)
|
||||||
|
FREE (allocator, message->unknown_fields[f].data);
|
||||||
|
if (message->unknown_fields != NULL)
|
||||||
|
FREE (allocator, message->unknown_fields);
|
||||||
|
|
||||||
FREE (allocator, message);
|
FREE (allocator, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user