summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 09:03:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 09:03:12 +0000
commite477c919db3a070ab4eab882b0fb92b7968ad3ab (patch)
tree9ab0899a81314afb81d24b4cec5113851774bb68 /io.c
parent50bcd83621bd313873141e3304c81273371afd6e (diff)
* io.c (pipe_open, rb_io_s_popen): clear temporary object to release
and prevent from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io.c b/io.c
index f1ce12e865..597f56cfe0 100644
--- a/io.c
+++ b/io.c
@@ -3626,6 +3626,7 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode)
exename = cmd;
cmdbuf = rb_str_tmp_new(rb_w32_argv_size(args));
cmd = rb_w32_join_argv(RSTRING_PTR(cmdbuf), args);
+ rb_str_resize(argbuf, 0);
}
while ((pid = rb_w32_pipe_exec(cmd, exename, openmode, &fd, &write_fd)) == -1) {
/* exec failed */
@@ -3775,6 +3776,7 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
tmp = rb_ary_dup(tmp);
RBASIC(tmp)->klass = 0;
port = pipe_open_v(RARRAY_LEN(tmp), RARRAY_PTR(tmp), mode);
+ rb_ary_clear(tmp);
}
else {
SafeStringValue(pname);