summaryrefslogtreecommitdiff
path: root/upb/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'upb/symtab.c')
-rw-r--r--upb/symtab.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/upb/symtab.c b/upb/symtab.c
index 58913b5..83f549e 100644
--- a/upb/symtab.c
+++ b/upb/symtab.c
@@ -427,6 +427,11 @@ bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status) {
n = upb_filedef_defcount(file);
defs = malloc(sizeof(*defs) * n);
+ if (defs == NULL) {
+ upb_status_seterrmsg(status, "Out of memory");
+ return false;
+ }
+
for (i = 0; i < n; i++) {
defs[i] = upb_filedef_mutabledef(file, i);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback