diff --git a/tool/lib/leakchecker.rb b/tool/lib/leakchecker.rb index bd0e24ba2e..a94d7a79b2 100644 --- a/tool/lib/leakchecker.rb +++ b/tool/lib/leakchecker.rb @@ -100,7 +100,7 @@ class LeakChecker next if /darwin/ =~ RUBY_PLATFORM and [0, -1].include?(s.dev) str << ' ' << s.inspect ensure - io.close + io&.close end end puts "Leaked file descriptor: #{test_name}: #{fd}#{str}"