Sender: marko@...1042... Date: 09 Aug 2007 17:01:11 +0300 Message-ID: MIME-Version: 1.0 From: Marko Rauhamaa Subject: [Openvpn-devel] Memory accumulation problem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net In openvpn-2.0.9 socket_connect() (socket.c), print_sockaddr() consumes memory without bounds if the server is permanently down or unreachable becauses gc_free() is not called from within the loop. Memory is consumed at 72 bytes every 5 seconds or 1.2 megabytes for each 24 hours (plus malloc overhead). That's enough to bring my openwrt box to its knees within a week or so. Proposed solution (untested): msg (D_LINK_ERRORS | M_ERRNO_SOCK, "TCP: connect to %s failed, will try again in %d seconds", print_sockaddr (remote, &gc), connect_retry_seconds); + gc_free (&gc); + gc = gc_new (); Marko -- Marko Rauhamaa mailto:marko@...1042... http://pacujo.net/marko/