Unverified Commit 55e58d85 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4268 from dearblue/null-safe-mrb_open_core

NULL safed `mrb_open_core()`
parents fc883de4 eb6aee11
...@@ -26,6 +26,7 @@ mrb_open_core(mrb_allocf f, void *ud) ...@@ -26,6 +26,7 @@ mrb_open_core(mrb_allocf f, void *ud)
static const struct mrb_context mrb_context_zero = { 0 }; static const struct mrb_context mrb_context_zero = { 0 };
mrb_state *mrb; mrb_state *mrb;
if (f == NULL) f = mrb_default_allocf;
mrb = (mrb_state *)(f)(NULL, NULL, sizeof(mrb_state), ud); mrb = (mrb_state *)(f)(NULL, NULL, sizeof(mrb_state), ud);
if (mrb == NULL) return NULL; if (mrb == NULL) return NULL;
......
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