changeset 407:ea0929224294

Fix another leak found by Klocwork
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Feb 2007 13:50:47 +0000
parents 2448ae3e75b5
children 28b10e93685c 253958302381
files cli-runopts.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/cli-runopts.c	Sat Feb 03 13:31:01 2007 +0000
+++ b/cli-runopts.c	Sat Feb 03 13:50:47 2007 +0000
@@ -358,8 +358,7 @@
 		TRACE(("connectaddr == NULL"))
 		goto fail;
 	}
-
-	connectaddr[0] = '\0';
+	*connectaddr = '\0';
 	connectaddr++;
 
 	connectport = strchr(connectaddr, ':');
@@ -367,8 +366,7 @@
 		TRACE(("connectport == NULL"))
 		goto fail;
 	}
-
-	connectport[0] = '\0';
+	*connectport = '\0';
 	connectport++;
 
 	newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList));
@@ -402,6 +400,8 @@
 	newfwd->next = *fwdlist;
 	*fwdlist = newfwd;
 
+	m_free(str);
+
 	TRACE(("leave addforward: done"))
 	return;