From cc19bcf11fdb008e74efdffab78b6680d2728385 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 21 Apr 2012 22:52:23 +0000 Subject: * lib/drb/ssl.rb: close accepted TCP socket if SSL accept is failed. [ruby-dev:45541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/drb/ssl.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/drb/ssl.rb') diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb index 17e2a73d85..ebd648b256 100644 --- a/lib/drb/ssl.rb +++ b/lib/drb/ssl.rb @@ -177,7 +177,11 @@ module DRb break if (@acl ? @acl.allow_socket?(soc) : true) soc.close end - ssl = @config.accept(soc) + begin + ssl = @config.accept(soc) + ensure + soc.close if $! + end self.class.new(uri, ssl, @config, true) rescue OpenSSL::SSL::SSLError warn("#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})") if @config[:verbose] -- cgit v1.2.3