[ruby/resolv] Close leaked FD

https://github.com/ruby/resolv/commit/49aefa3bba
This commit is contained in:
Nobuyoshi Nakada 2023-11-26 10:03:45 +09:00 committed by git
parent 87c3deacf4
commit 003f06bde4

View File

@ -653,5 +653,7 @@ class TestResolvDNS < Test::Unit::TestCase
config[:raise_timeout_errors] = true
r = Resolv.new([Resolv::DNS.new(config)])
assert_raise(Resolv::ResolvError) { r.getaddresses('www.google.com') }
ensure
sock&.close
end
end