diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-02-10 08:58:10 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-02-10 08:58:10 +0900 |
| commit | 55e58d85122bc65b3ab9428ea79d863ab0f8170e (patch) | |
| tree | ba22779b48ac2c80feb78026ba1ab5eef25e3009 /src/state.c | |
| parent | fc883de45891e02a24bdb0df44de744829f267e7 (diff) | |
| parent | eb6aee117b8f33810a285a248cf21d2e2409823a (diff) | |
| download | mruby-55e58d85122bc65b3ab9428ea79d863ab0f8170e.tar.gz mruby-55e58d85122bc65b3ab9428ea79d863ab0f8170e.zip | |
Merge pull request #4268 from dearblue/null-safe-mrb_open_core
NULL safed `mrb_open_core()`
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c index e678b37f3..c3ce1dc33 100644 --- a/src/state.c +++ b/src/state.c @@ -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; |
