comparison svr-tcpfwd.c @ 403:75940fef22dd

Fix free() of null pointer found by Klocwork
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Feb 2007 09:42:22 +0000
parents 7ce577234a10
children b895f91c2ee6
comparison
equal deleted inserted replaced
372:fbcc3b5b34f3 403:75940fef22dd
214 214
215 out: 215 out:
216 if (ret == DROPBEAR_FAILURE) { 216 if (ret == DROPBEAR_FAILURE) {
217 /* we only free it if a listener wasn't created, since the listener 217 /* we only free it if a listener wasn't created, since the listener
218 * has to remember it if it's to be cancelled */ 218 * has to remember it if it's to be cancelled */
219 m_free(tcpinfo->listenaddr); 219 if (tcpinfo) {
220 m_free(tcpinfo); 220 m_free(tcpinfo->listenaddr);
221 m_free(tcpinfo);
222 }
221 } 223 }
222 TRACE(("leave remotetcpreq")) 224 TRACE(("leave remotetcpreq"))
223 return ret; 225 return ret;
224 } 226 }
225 227