summaryrefslogtreecommitdiff
path: root/upb/symtab.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2016-04-06 14:28:45 -0700
committerJosh Haberman <jhaberman@gmail.com>2016-04-06 14:28:45 -0700
commitf8c26358f0b87a9c90be3f038cdea5bdcae185a0 (patch)
treea51e3b278d368ebd4fc01b0fff68c8f3f0701299 /upb/symtab.c
parente9d79d2441732264e2b990a5b2dc76d13724db07 (diff)
Changes for PR comments.
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