Permalink
Browse files

Verify that memory for mrb_state was allocated

  • Loading branch information...
jonforums committed Jun 3, 2012
1 parent 7009a1d commit 49aa42f3a99195bb64f97f37ebb4748716be5ecd
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/state.c
View
@@ -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;

0 comments on commit 49aa42f

Please sign in to comment.