From f18d5b2efeb728ce79027890ef08307f2f41f787 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Mon, 27 Nov 2017 14:23:55 -0800 Subject: [PATCH] Attempted fix for github issue #597, leaking sockets. Added call to closenatpmp() after failure to init --- osdep/PortMapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/osdep/PortMapper.cpp b/osdep/PortMapper.cpp index 825972b00..9aeeb8d6f 100644 --- a/osdep/PortMapper.cpp +++ b/osdep/PortMapper.cpp @@ -123,6 +123,7 @@ public: if (initnatpmp(&natpmp,0,0) != 0) { mode = 1; + closenatpmp(&natpmp); #ifdef ZT_PORTMAPPER_TRACE PM_TRACE("PortMapper: NAT-PMP: init failed, switching to UPnP mode" ZT_EOL_S); #endif