From 665b768cef475fae9e6322bfb72875cd6fc0aa60 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 7 Apr 2011 13:38:27 +0000 Subject: [PATCH] Fix leak found by Klocwork --HG-- extra : convert_revision : 51ce088e100e9ea150efc6bf3d021f019a46b2f5 --- svr-tcpfwd.c | 8 +++----- 1 file 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);