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:
lahiker42 2008-12-17 02:40:32 +00:00
parent 1cbc75c122
commit 2650c6744a

View File

@ -1592,6 +1592,12 @@ protobuf_c_message_free_unpacked (ProtobufCMessage *message,
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);
}