aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/process.c b/process.c
index 5601d82cdc..c1c8432a45 100644
--- a/process.c
+++ b/process.c
@@ -2358,11 +2358,9 @@ open_func(void *ptr)
static void
rb_execarg_allocate_dup2_tmpbuf(struct rb_execarg *eargp, long len)
{
- eargp->dup2_tmpbuf =
- rb_imemo_tmpbuf_auto_free_pointer(
- ruby_xmalloc(
- run_exec_dup2_tmpbuf_size(
- len)));
+ VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer(NULL);
+ ((rb_imemo_tmpbuf_t *)tmpbuf)->ptr = ruby_xmalloc(run_exec_dup2_tmpbuf_size(len));
+ eargp->dup2_tmpbuf = tmpbuf;
}
static VALUE