Mercurial > dropbear
comparison tcp-accept.c @ 371:6aea2cfc113e
Fix memory leak found by Klocwork
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 02 Nov 2006 16:45:43 +0000 |
parents | 3cea9d789cca |
children | a124aff0cbf1 |
comparison
equal
deleted
inserted
replaced
370:9a789fc03f40 | 371:6aea2cfc113e |
---|---|
124 dropbear_log(LOG_INFO, "TCP forward failed: %s", errstring); | 124 dropbear_log(LOG_INFO, "TCP forward failed: %s", errstring); |
125 m_free(errstring); | 125 m_free(errstring); |
126 TRACE(("leave listen_tcpfwd: dropbear_listen failed")) | 126 TRACE(("leave listen_tcpfwd: dropbear_listen failed")) |
127 return DROPBEAR_FAILURE; | 127 return DROPBEAR_FAILURE; |
128 } | 128 } |
129 | 129 m_free(errstring); |
130 | |
131 /* new_listener will close the socks if it fails */ | |
130 listener = new_listener(socks, nsocks, CHANNEL_ID_TCPFORWARDED, tcpinfo, | 132 listener = new_listener(socks, nsocks, CHANNEL_ID_TCPFORWARDED, tcpinfo, |
131 tcp_acceptor, cleanup_tcp); | 133 tcp_acceptor, cleanup_tcp); |
132 | 134 |
133 if (listener == NULL) { | 135 if (listener == NULL) { |
134 m_free(tcpinfo); | |
135 TRACE(("leave listen_tcpfwd: listener failed")) | 136 TRACE(("leave listen_tcpfwd: listener failed")) |
136 return DROPBEAR_FAILURE; | 137 return DROPBEAR_FAILURE; |
137 } | 138 } |
138 | 139 |
139 TRACE(("leave listen_tcpfwd: success")) | 140 TRACE(("leave listen_tcpfwd: success")) |