summaryrefslogtreecommitdiff
path: root/imemo.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-09-08 17:20:05 +0200
committerPeter Zhu <peter@peterzhu.ca>2025-09-17 09:25:17 -0400
commitcfc5c565038d3ed00a739135911e6188929c729a (patch)
treef6609bb793838c0ffd8b67db7b21ff0d830b4a74 /imemo.c
parent3f3497558146c46350b740db2e71fdf28d30c204 (diff)
Clear out memory for newly allocated tmpbuf
Diffstat (limited to 'imemo.c')
-rw-r--r--imemo.c3
1 files changed, 3 insertions, 0 deletions
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;
}