Skip to content

Commit

Permalink
Merge pull request #4268 from dearblue/null-safe-mrb_open_core
Browse files Browse the repository at this point in the history
NULL safed `mrb_open_core()`
  • Loading branch information
matz committed Feb 9, 2019
2 parents fc883de + eb6aee1 commit 55e58d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/state.c
Expand Up @@ -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;

Expand Down

0 comments on commit 55e58d8

Please sign in to comment.