diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-06-03 09:41:32 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-06-03 09:41:32 -0700 |
| commit | d8f1e17ef6282b15c945f1feb5b75c36be96f20e (patch) | |
| tree | e036ad5bf1629f748af8f3084ca8a15cccd07e19 /tools/mirb | |
| parent | 0719f523048ecd6da1d28e4b2eba7794e419dd36 (diff) | |
| parent | 2fff59dc8674ad6689acc5080463eede4c5bb2ab (diff) | |
| download | mruby-d8f1e17ef6282b15c945f1feb5b75c36be96f20e.tar.gz mruby-d8f1e17ef6282b15c945f1feb5b75c36be96f20e.zip | |
Merge pull request #239 from thecodeshop/jf/mrb_open
guard mrb_open mem allocation and downstream usage
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)); |
