changeset 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 fbcc3b5b34f3
children a588558bfc94
files svr-tcpfwd.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;