summaryrefslogtreecommitdiffhomepage
path: root/svr-tcpfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2007-02-03 09:42:22 +0000
committerMatt Johnston <matt@ucc.asn.au>2007-02-03 09:42:22 +0000
commit85f22c9f098e853a6c6836d1af8afcee3ea6c4b7 (patch)
tree09fef14ebdf92fe1927824e0156195bbd3de4d6d /svr-tcpfwd.c
parent7eee3ceb7042dcdb7373373afaee8bfc0fe7c52f (diff)
Fix free() of null pointer found by Klocwork
--HG-- extra : convert_revision : 8084d31816a059cc07c6180b6fd5aa86770845cb
Diffstat (limited to 'svr-tcpfwd.c')
-rw-r--r--svr-tcpfwd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/svr-tcpfwd.c b/svr-tcpfwd.c
index 6391c4c..0151ffe 100644
--- a/svr-tcpfwd.c
+++ b/svr-tcpfwd.c
@@ -216,8 +216,10 @@ out:
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;