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 /src/state.c | |
| 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 'src/state.c')
| -rw-r--r-- | src/state.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c index 727bd8ecb..e4729ca70 100644 --- a/src/state.c +++ b/src/state.c @@ -16,6 +16,7 @@ mrb_state* mrb_open_allocf(mrb_allocf f) { mrb_state *mrb = (f)(NULL, NULL, sizeof(mrb_state)); + if (mrb == NULL) return NULL; memset(mrb, 0, sizeof(mrb_state)); mrb->allocf = f; |
