Simplify the logic in `mrb_realloc`; ref
@@ -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); */
