diff --git a/src/util/UpnpPunch.py b/src/util/UpnpPunch.py index 21d34836..1e47d6a3 100644 --- a/src/util/UpnpPunch.py +++ b/src/util/UpnpPunch.py @@ -57,6 +57,8 @@ def perform_m_search(local_ip): return sock.recv(2048) except socket.error: raise UpnpError("No reply from IGD using {} as IP".format(local_ip)) + finally: + sock.close() def _retrieve_location_from_ssdp(response):