summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/state.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index 9c16524f2..8d6993b6f 100644
--- a/src/state.c
+++ b/src/state.c
@@ -110,6 +110,10 @@ mrb_open_allocf(mrb_allocf f, void *ud)
{
mrb_state *mrb = mrb_open_core(f, ud);
+ if (mrb == NULL) {
+ return NULL;
+ }
+
#ifndef DISABLE_GEMS
mrb_init_mrbgems(mrb);
mrb_gc_arena_restore(mrb, 0);