diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-07-03 00:27:05 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-07-03 00:27:05 -0700 |
commit | 9eaab71e99b1fedd8b2a29a99b8512b01719469a (patch) | |
tree | 40cc85f8d662377b043079d9ba295e71ce44fa3c /upb_msg.c | |
parent | 485b96466257a972042b49f45cb79bc0d1093748 (diff) |
Fixed bugs and memory leaks.
Diffstat (limited to 'upb_msg.c')
-rw-r--r-- | upb_msg.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -16,7 +16,8 @@ static int div_round_up(int numerator, int denominator) { } static int compare_fields(const void *e1, const void *e2) { - const google_protobuf_FieldDescriptorProto *fd1 = e1, *fd2 = e2; + const google_protobuf_FieldDescriptorProto *fd1 = *(void**)e1; + const google_protobuf_FieldDescriptorProto *fd2 = *(void**)e2; /* Required fields go before non-required. */ bool req1 = fd1->label == GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_REQUIRED; bool req2 = fd2->label == GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_REQUIRED; @@ -90,6 +91,7 @@ void upb_msg_free(struct upb_msg *m) upb_inttable_free(&m->fields_by_num); upb_strtable_free(&m->fields_by_name); free(m->fields); + free(m->field_descriptors); } void *upb_msg_new(struct upb_msg *m) |