summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-27 07:18:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-27 07:18:27 +0000
commit2fbc63b8a8a7a72bd986a37ab423d4d87f54ae12 (patch)
treeb534ecbe690c705d909f65b9ee7648eab634f063 /io.c
parentbc855ef1391bb79ca3554f67ae2d3aad19178d94 (diff)
io.c: ARGF fd leak
* io.c (argf_next_argv): fix leak of fd after breaking in #each method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index d36bd48d5c..37b57e019b 100644
--- a/io.c
+++ b/io.c
@@ -8023,6 +8023,7 @@ argf_next_argv(VALUE argf)
}
if (ARGF.next_p == 1) {
+ if (ARGF.init_p == 1) argf_close(argf);
retry:
if (RARRAY_LEN(ARGF.argv) > 0) {
VALUE filename = rb_ary_shift(ARGF.argv);