diff --git a/util.c b/util.c index 8a18814937..2e887618b1 100644 --- a/util.c +++ b/util.c @@ -564,7 +564,7 @@ ruby_getcwd(void) rb_imemo_tmpbuf_set_ptr(guard, buf); buf = xrealloc(buf, size); } - rb_free_tmp_buffer(&guard); + rb_imemo_tmpbuf_set_ptr(guard, NULL); return buf; }