summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorJon <[email protected]>2012-06-03 09:27:32 -0400
committerJon <[email protected]>2012-06-03 11:11:34 -0400
commit49aa42f3a99195bb64f97f37ebb4748716be5ecd (patch)
tree404cb64d17d11afc88c227a592f19cf34585c67b /src/state.c
parent7009a1d8f5271fcd0b06a86645ad28e40c2bc5d9 (diff)
downloadmruby-49aa42f3a99195bb64f97f37ebb4748716be5ecd.tar.gz
mruby-49aa42f3a99195bb64f97f37ebb4748716be5ecd.zip
Verify that memory for mrb_state was allocated
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c1
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;