summaryrefslogtreecommitdiffhomepage
path: root/svr-tcpfwd.c
diff options
context:
space:
mode:
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;