diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm index 7d21f4e83..96e368189 100644 --- a/util/TLSProxy/Proxy.pm +++ b/util/TLSProxy/Proxy.pm @@ -269,7 +269,9 @@ sub clientstart ); $retry--; - if (!$server_sock) { + if ($@ || !defined($server_sock)) { + $server_sock->close() if defined($server_sock); + undef $server_sock; if ($retry) { #Sleep for a short while select(undef, undef, undef, 0.1);