Skip to content
Permalink
Browse files
Simplify the logic in mrb_realloc; ref #3679
  • Loading branch information
matz committed May 31, 2017
1 parent 7dbbd77 commit b4a4e3c09abf2e9f790d465539b63e9aa82baa05
Showing 1 changed file with 2 additions and 1 deletion.
@@ -215,7 +215,8 @@ mrb_realloc(mrb_state *mrb, void *p, size_t len)
void *p2;

p2 = mrb_realloc_simple(mrb, p, len);
if (!p2 && len) {
if (len == 0) return p2;
if (p2 == NULL) {
if (mrb->gc.out_of_memory) {
mrb_exc_raise(mrb, mrb_obj_value(mrb->nomem_err));
/* mrb_panic(mrb); */

0 comments on commit b4a4e3c

Please sign in to comment.