diff options
| author | Jon <[email protected]> | 2012-06-03 10:04:51 -0400 |
|---|---|---|
| committer | Jon <[email protected]> | 2012-06-03 11:11:35 -0400 |
| commit | 2fff59dc8674ad6689acc5080463eede4c5bb2ab (patch) | |
| tree | 605bd27f9e7b00abde90d0df0e57956ed39c9c0b /tools/mirb | |
| parent | 49aa42f3a99195bb64f97f37ebb4748716be5ecd (diff) | |
| download | mruby-2fff59dc8674ad6689acc5080463eede4c5bb2ab.tar.gz mruby-2fff59dc8674ad6689acc5080463eede4c5bb2ab.zip | |
Check mrb_open return value for NULL
Diffstat (limited to 'tools/mirb')
| -rw-r--r-- | tools/mirb/mirb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/mirb/mirb.c b/tools/mirb/mirb.c index 59e5046cb..35558acfb 100644 --- a/tools/mirb/mirb.c +++ b/tools/mirb/mirb.c @@ -142,6 +142,11 @@ main(void) /* new interpreter instance */ mrb_interpreter = mrb_open(); + if (mrb_interpreter == NULL) { + fprintf(stderr, "Invalid mrb_interpreter, exiting mirb"); + return EXIT_FAILURE; + } + /* new parser instance */ parser = mrb_parser_new(mrb_interpreter); memset(ruby_code, 0, sizeof(*ruby_code)); |
