Commit c9b7cee2 authored by cremno's avatar cremno Committed by Yukihiro "Matz" Matsumoto

check `mrb_open` return value

parent c6ce4330
...@@ -96,6 +96,10 @@ main(int argc, char **argv) ...@@ -96,6 +96,10 @@ main(int argc, char **argv)
} }
mrb = mrb_open(); mrb = mrb_open();
if (mrb == NULL) {
fputs("Invalid mrb_state, exiting mruby-strip\n", stderr);
return EXIT_FAILURE;
}
ireps = (mrb_irep**)malloc(sizeof(mrb_irep*) * argc); ireps = (mrb_irep**)malloc(sizeof(mrb_irep*) * argc);
for (i = args_result; i < argc; ++i) { for (i = args_result; i < argc; ++i) {
......
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