# HG changeset patch # User Matt Johnston # Date 1170495742 0 # Node ID 75940fef22dd9a80934653c5d3dca8ed1c475412 # Parent fbcc3b5b34f372a9a9e86db20dfcf661c5f50ea4 Fix free() of null pointer found by Klocwork diff -r fbcc3b5b34f3 -r 75940fef22dd svr-tcpfwd.c --- a/svr-tcpfwd.c Thu Nov 02 16:52:59 2006 +0000 +++ b/svr-tcpfwd.c Sat Feb 03 09:42:22 2007 +0000 @@ -216,8 +216,10 @@ if (ret == DROPBEAR_FAILURE) { /* we only free it if a listener wasn't created, since the listener * has to remember it if it's to be cancelled */ - m_free(tcpinfo->listenaddr); - m_free(tcpinfo); + if (tcpinfo) { + m_free(tcpinfo->listenaddr); + m_free(tcpinfo); + } } TRACE(("leave remotetcpreq")) return ret;