diff cli-runopts.c @ 410:b895f91c2ee6

merge of 'b1dd3b94e60a07a176dba2b035ac79968595990a' and 'bcb33fce2fad01a7626598209d43af3571bd86f0'
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Feb 2007 10:32:59 +0000
parents 9341570412e5 ea0929224294
children 47bcc3536bd5
line wrap: on
line diff
--- a/cli-runopts.c	Sat Feb 03 08:20:34 2007 +0000
+++ b/cli-runopts.c	Sun Feb 04 10:32:59 2007 +0000
@@ -373,8 +373,7 @@
 		TRACE(("connectaddr == NULL"))
 		goto fail;
 	}
-
-	connectaddr[0] = '\0';
+	*connectaddr = '\0';
 	connectaddr++;
 
 	connectport = strchr(connectaddr, ':');
@@ -382,8 +381,7 @@
 		TRACE(("connectport == NULL"))
 		goto fail;
 	}
-
-	connectport[0] = '\0';
+	*connectport = '\0';
 	connectport++;
 
 	newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList));
@@ -417,6 +415,8 @@
 	newfwd->next = *fwdlist;
 	*fwdlist = newfwd;
 
+	m_free(str);
+
 	TRACE(("leave addforward: done"))
 	return;