diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-09-15 08:45:34 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-09-15 08:45:34 +0900 |
| commit | e91b7d640c8ac6af08f4571e71bb867b62fc4445 (patch) | |
| tree | 95cebe55527e6b41eb5bca2dcac2af61d85c1611 | |
| parent | e8f88daa9c0486485072a1fb1c61a60ede0ff5c0 (diff) | |
| parent | a085c04e3741825ab4c4ceda60b640e250ae56d5 (diff) | |
| download | mruby-e91b7d640c8ac6af08f4571e71bb867b62fc4445.tar.gz mruby-e91b7d640c8ac6af08f4571e71bb867b62fc4445.zip | |
Merge pull request #2951 from tatsuhiro-t/mrb_close_with_nullptr
Don't crash if NULL is passed to mrb_close
| -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 2efd34334..bfd99e4c3 100644 --- a/src/state.c +++ b/src/state.c @@ -234,6 +234,7 @@ mrb_free_context(mrb_state *mrb, struct mrb_context *c) MRB_API void mrb_close(mrb_state *mrb) { + if (!mrb) return; if (mrb->atexit_stack_len > 0) { mrb_int i; for (i = mrb->atexit_stack_len; i > 0; --i) { |
