From 4a68605bc839106cf0e4899a9f9a258e6f86fe30 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Tue, 22 Sep 2015 11:00:57 +0100 Subject: [PATCH] Correct a possible DNSService connection leak There was a potential codepath where, if after parsing a packet, an exception was raused, we may leave TCP sockets around without explicitly closing them Change-Id: I6d619d05c7d0250cb5ae55212129e0d849c66c9d --- designate/service.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designate/service.py b/designate/service.py index 952d91ff8..eecb91c2e 100644 --- a/designate/service.py +++ b/designate/service.py @@ -340,15 +340,16 @@ class DNSService(object): # Handle UDP Responses self._dns_sock_udp.sendto(response, addr) - # Close the TCP connection if we have one. - if client: - client.close() - except Exception: LOG.exception(_LE("Unhandled exception while processing request " "from %(host)s:%(port)d") % {'host': addr[0], 'port': addr[1]}) + # Close the TCP connection if we have one. + if client: + client.close() + + _launcher = None