summaryrefslogtreecommitdiffhomepage
path: root/src/gc.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-07-02 10:41:03 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-07-02 10:41:03 +0900
commit97319697c8f9f6ff27b32589947e1918e3015503 (patch)
treed45ad6336478a9f527be3403c600e1fb433af432 /src/gc.c
parent612e5d6aad7f224008735d57b19e5a81556cfd31 (diff)
downloadmruby-97319697c8f9f6ff27b32589947e1918e3015503.tar.gz
mruby-97319697c8f9f6ff27b32589947e1918e3015503.zip
Cancel 9cdf439
Should not free the pointer in `realloc` since it can cause use-after-free problem.
Diffstat (limited to 'src/gc.c')
-rw-r--r--src/gc.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/gc.c b/src/gc.c
index 6c83911d5..e1892080f 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -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);
}