summaryrefslogtreecommitdiff
path: root/src/upb_def.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_def.c')
-rw-r--r--src/upb_def.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/upb_def.c b/src/upb_def.c
index 4484055..49d5f21 100644
--- a/src/upb_def.c
+++ b/src/upb_def.c
@@ -110,7 +110,8 @@ void _upb_msgdef_free(struct upb_msgdef *m)
for (unsigned int i = 0; i < m->num_fields; i++) {
struct upb_fielddef *f = &m->fields[i];
upb_string_unref(f->name);
- upb_def_unref(f->ref, f->type);
+ if (upb_issubmsg(f) || f->type == UPB_TYPENUM(ENUM))
+ upb_def_unref(f->ref, f->type);
}
free(m->fields);
free(m);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback