summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--upb/def.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/upb/def.c b/upb/def.c
index 01bbe5f..ceaced2 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -2309,6 +2309,9 @@ bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status) {
bool ret;
n = upb_filedef_defcount(file);
+ if (n == 0) {
+ return true;
+ }
defs = upb_gmalloc(sizeof(*defs) * n);
if (defs == NULL) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback