summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorJon <[email protected]>2012-06-03 10:04:51 -0400
committerJon <[email protected]>2012-06-03 11:11:35 -0400
commit2fff59dc8674ad6689acc5080463eede4c5bb2ab (patch)
tree605bd27f9e7b00abde90d0df0e57956ed39c9c0b /test
parent49aa42f3a99195bb64f97f37ebb4748716be5ecd (diff)
downloadmruby-2fff59dc8674ad6689acc5080463eede4c5bb2ab.tar.gz
mruby-2fff59dc8674ad6689acc5080463eede4c5bb2ab.zip
Check mrb_open return value for NULL
Diffstat (limited to 'test')
-rw-r--r--test/driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/driver.c b/test/driver.c
index 4651d75fc..6b42d025b 100644
--- a/test/driver.c
+++ b/test/driver.c
@@ -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));