Check mrb_open return value for NULL

This commit is contained in:
Jon
2012-06-03 10:04:51 -04:00
parent 49aa42f3a9
commit 2fff59dc86
7 changed files with 70 additions and 0 deletions
+5
View File
@@ -36,6 +36,11 @@ main(void)
/* new interpreter instance */
mrb = mrb_open();
if (mrb == NULL) {
fprintf(stderr, "Invalid mrb_state, exiting test driver");
return EXIT_FAILURE;
}
mrb_init_mrbtest(mrb);
parser = mrb_parse_nstring(mrb, prog, strlen(prog));