From cfc5c565038d3ed00a739135911e6188929c729a Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 8 Sep 2025 17:20:05 +0200 Subject: Clear out memory for newly allocated tmpbuf --- imemo.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'imemo.c') diff --git a/imemo.c b/imemo.c index 74eae5678f..10ac960095 100644 --- a/imemo.c +++ b/imemo.c @@ -54,6 +54,9 @@ rb_imemo_tmpbuf_new(void) VALUE flags = T_IMEMO | (imemo_tmpbuf << FL_USHIFT); NEWOBJ_OF(obj, rb_imemo_tmpbuf_t, 0, flags, sizeof(rb_imemo_tmpbuf_t), NULL); + obj->ptr = NULL; + obj->cnt = 0; + return (VALUE)obj; } -- cgit v1.2.3