summaryrefslogtreecommitdiff
path: root/upb_msg.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-07-03 00:27:05 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-07-03 00:27:05 -0700
commit9eaab71e99b1fedd8b2a29a99b8512b01719469a (patch)
tree40cc85f8d662377b043079d9ba295e71ce44fa3c /upb_msg.c
parent485b96466257a972042b49f45cb79bc0d1093748 (diff)
Fixed bugs and memory leaks.
Diffstat (limited to 'upb_msg.c')
-rw-r--r--upb_msg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/upb_msg.c b/upb_msg.c
index 86c46de..d6b1594 100644
--- a/upb_msg.c
+++ b/upb_msg.c
@@ -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)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback