Commit 5ee00453 authored by Tatsuhiko Kubo's avatar Tatsuhiko Kubo

Fix error handling for mrb_pool_realloc().

mrb_pool_alloc() may return NULL.
parent d49f8517
......@@ -166,6 +166,9 @@ mrb_pool_realloc(mrb_pool *pool, void *p, size_t oldlen, size_t newlen)
page = page->next;
}
np = mrb_pool_alloc(pool, newlen);
if (np == NULL) {
return NULL;
}
memcpy(np, p, oldlen);
return np;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment