# HG changeset patch # User Matt Johnston # Date 1162485943 0 # Node ID 6aea2cfc113e3787fb1e9a223db9f0681ed71d51 # Parent 9a789fc03f40e27ac571a3e8b41a65ecad060a29 Fix memory leak found by Klocwork diff -r 9a789fc03f40 -r 6aea2cfc113e tcp-accept.c --- a/tcp-accept.c Thu Nov 02 16:10:18 2006 +0000 +++ b/tcp-accept.c Thu Nov 02 16:45:43 2006 +0000 @@ -126,12 +126,13 @@ TRACE(("leave listen_tcpfwd: dropbear_listen failed")) return DROPBEAR_FAILURE; } - + m_free(errstring); + + /* new_listener will close the socks if it fails */ listener = new_listener(socks, nsocks, CHANNEL_ID_TCPFORWARDED, tcpinfo, tcp_acceptor, cleanup_tcp); if (listener == NULL) { - m_free(tcpinfo); TRACE(("leave listen_tcpfwd: listener failed")) return DROPBEAR_FAILURE; }