mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #4268 from dearblue/null-safe-mrb_open_core
NULL safed `mrb_open_core()`
This commit is contained in:
@@ -26,6 +26,7 @@ mrb_open_core(mrb_allocf f, void *ud)
|
||||
static const struct mrb_context mrb_context_zero = { 0 };
|
||||
mrb_state *mrb;
|
||||
|
||||
if (f == NULL) f = mrb_default_allocf;
|
||||
mrb = (mrb_state *)(f)(NULL, NULL, sizeof(mrb_state), ud);
|
||||
if (mrb == NULL) return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user