From: Michal 'vorner' Vaner Date: Wed, 3 Apr 2013 10:04:44 +0000 (+0200) Subject: [2888] Close socket even on connect error X-Git-Tag: bind10-1.2.0beta1-release~488^2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd65ec46d25bb56ab77f50ebf8d6e431fda2d478;p=thirdparty%2Fkea.git [2888] Close socket even on connect error Even if we fail to connect, close the socket. It is loosely related to the previous commit, as that one used unsuccessful connection attempts to discover msgq is not ready yet and the unit tests complained. It should have no real effect, since the garbage collector would reclaim the socket after a while anyway. --- diff --git a/src/lib/python/isc/cc/session.py b/src/lib/python/isc/cc/session.py index fced424c64..636dd08f2b 100644 --- a/src/lib/python/isc/cc/session.py +++ b/src/lib/python/isc/cc/session.py @@ -67,7 +67,9 @@ class Session: logger.debug(logger.DBGLVL_TRACE_BASIC, PYCC_LNAME_RECEIVED, self._lname) except socket.error as se: - raise SessionError(se) + if self._socket: + self._socket.close() + raise SessionError(se) @property def lname(self):