diff options
| author | dearblue <[email protected]> | 2019-02-09 20:22:08 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2019-02-09 20:22:08 +0900 |
| commit | eb6aee117b8f33810a285a248cf21d2e2409823a (patch) | |
| tree | ba22779b48ac2c80feb78026ba1ab5eef25e3009 /src/state.c | |
| parent | fc883de45891e02a24bdb0df44de744829f267e7 (diff) | |
| download | mruby-eb6aee117b8f33810a285a248cf21d2e2409823a.tar.gz mruby-eb6aee117b8f33810a285a248cf21d2e2409823a.zip | |
`mrb_default_allocf()` is default allocator for NULL safe
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; |
