Commit bceaade1 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2543 from cubicdaiya/issues/mrb_open_allocf_error_handlings

Fix error handling for mrb_open_allocf().
parents 28cf769a 53a7549e
...@@ -110,6 +110,10 @@ mrb_open_allocf(mrb_allocf f, void *ud) ...@@ -110,6 +110,10 @@ mrb_open_allocf(mrb_allocf f, void *ud)
{ {
mrb_state *mrb = mrb_open_core(f, ud); mrb_state *mrb = mrb_open_core(f, ud);
if (mrb == NULL) {
return NULL;
}
#ifndef DISABLE_GEMS #ifndef DISABLE_GEMS
mrb_init_mrbgems(mrb); mrb_init_mrbgems(mrb);
mrb_gc_arena_restore(mrb, 0); mrb_gc_arena_restore(mrb, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment