Fix memory leak found by Klocwork

--HG--
extra : convert_revision : 4b40828a0c3781bacfb2b92af639e88065bcc61a
This commit is contained in:
Matt Johnston 2006-11-02 16:45:43 +00:00
parent a0aefb3d3f
commit 19b89a0e19

View File

@ -126,12 +126,13 @@ int listen_tcpfwd(struct TCPListener* tcpinfo) {
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;
}