Commit a7977149 authored by Denis Bilenko's avatar Denis Bilenko

socket: fix socket leak in create_connection

parent 0e0b04d2
......@@ -627,6 +627,7 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
sock.connect(sa)
return sock
except error, msg:
sys.exc_clear()
if sock is not None:
sock.close()
raise msg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment