summaryrefslogtreecommitdiffhomepage
path: root/src/variable.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-08-06 20:47:35 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-08-06 20:47:35 +0900
commit3dc8d9d7b3d0be2f91fa050a13e3b422500df628 (patch)
tree41d9f59c090ce2a0a6bd254346f718235ccf992f /src/variable.c
parent151d0c14ed8447cf62d1cc72680bf6d6fafe548e (diff)
downloadmruby-3dc8d9d7b3d0be2f91fa050a13e3b422500df628.tar.gz
mruby-3dc8d9d7b3d0be2f91fa050a13e3b422500df628.zip
Should have cleared `mrb->globals` in `mrb_gc_free_gv`; fix #4618
Diffstat (limited to 'src/variable.c')
-rw-r--r--src/variable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/variable.c b/src/variable.c
index 32416da4e..ab3bea327 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -268,8 +268,10 @@ mrb_gc_mark_gv(mrb_state *mrb)
void
mrb_gc_free_gv(mrb_state *mrb)
{
- if (mrb->globals)
+ if (mrb->globals) {
iv_free(mrb, mrb->globals);
+ mrb->globals = NULL;
+ }
}
void