Skip to content

Commit

Permalink
Cancel 9cdf439
Browse files Browse the repository at this point in the history
Should not free the pointer in `realloc` since it can cause
use-after-free problem.
  • Loading branch information
matz committed Jul 2, 2020
1 parent 612e5d6 commit 9731969
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/gc.c
Expand Up @@ -225,7 +225,6 @@ 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);
mrb->gc.out_of_memory = TRUE;
mrb_raise_nomemory(mrb);
}
Expand Down

0 comments on commit 9731969

Please sign in to comment.