Commit aa578c34 authored by Hiroshi Mimaki's avatar Hiroshi Mimaki

Revert "Free the original pointer if `realloc` failed."

This reverts commit 9cdf439d.
parent ac836000
......@@ -225,10 +225,15 @@ mrb_realloc(mrb_state *mrb, void *p, size_t len)
p2 = mrb_realloc_simple(mrb, p, len);
if (len == 0) return p2;
if (p2 == NULL) {
mrb_free(mrb, p);
if (mrb->gc.out_of_memory) {
mrb_raise_nomemory(mrb);
/* mrb_panic(mrb); */
}
else {
mrb->gc.out_of_memory = TRUE;
mrb_raise_nomemory(mrb);
}
}
else {
mrb->gc.out_of_memory = FALSE;
}
......
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