Skip to content

Commit 9574ced

Browse files
akrtmm1
authored andcommitted
Avoid tempfile leaks using Tempfile.create instead of Tempfile.open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 4e15c2e commit 9574ced

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/resolv/test_addr.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_invalid_ipv4_address
1717

1818
def test_invalid_byte_comment
1919
bug9273 = '[ruby-core:59239] [Bug #9273]'
20-
Tempfile.open('resolv_test_addr_') do |tmpfile|
20+
Tempfile.create('resolv_test_addr_') do |tmpfile|
2121
tmpfile.print("\xff\x00\x40")
2222
tmpfile.close
2323
hosts = Resolv::Hosts.new(tmpfile.path)

test/resolv/test_dns.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_no_server
153153

154154
def test_invalid_byte_comment
155155
bug9273 = '[ruby-core:59239] [Bug #9273]'
156-
Tempfile.open('resolv_test_dns_') do |tmpfile|
156+
Tempfile.create('resolv_test_dns_') do |tmpfile|
157157
tmpfile.print("\xff\x00\x40")
158158
tmpfile.close
159159
assert_nothing_raised(ArgumentError, bug9273) do

0 commit comments

Comments
 (0)