diff options
author | Bo Yang <teboring@google.com> | 2017-06-01 12:34:06 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2017-06-01 12:34:06 -0700 |
commit | 0a9b07ba86cd4aa620d0b061a56d239f40795e39 (patch) | |
tree | e06b530e2bea81b3167c54197d14d24c4aa4b6d4 | |
parent | 04fcf0b112deab5bf83673e78e3825155d6fdee1 (diff) |
Fix upb load descriptor when no messages defined in prorto.
-rw-r--r-- | upb/def.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) { |