summaryrefslogtreecommitdiffhomepage
path: root/svr-tcpfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2011-04-07 13:38:27 +0000
committerMatt Johnston <matt@ucc.asn.au>2011-04-07 13:38:27 +0000
commit665b768cef475fae9e6322bfb72875cd6fc0aa60 (patch)
treef1fe2540c3f69751b885dd9b6dff36e4edcbf15e /svr-tcpfwd.c
parentb272b967e24285d7330f189503455fbefcc7fde0 (diff)
Fix leak found by Klocwork
--HG-- extra : convert_revision : 51ce088e100e9ea150efc6bf3d021f019a46b2f5
Diffstat (limited to 'svr-tcpfwd.c')
-rw-r--r--svr-tcpfwd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/svr-tcpfwd.c b/svr-tcpfwd.c
index 7b37449..bf529cc 100644
--- a/svr-tcpfwd.c
+++ b/svr-tcpfwd.c
@@ -213,12 +213,10 @@ static int svr_remotetcpreq() {
if (!opts.listen_fwd_all
|| (strcmp(tcpinfo->listenaddr, "localhost") == 0) ) {
// NULL means "localhost only"
- tcpinfo->listenaddr = NULL;
+ m_free(bindaddr);
+ bindaddr = NULL;
}
- else
- {
- tcpinfo->listenaddr = bindaddr;
- }
+ tcpinfo->listenaddr = bindaddr;
ret = listen_tcpfwd(tcpinfo);