summaryrefslogtreecommitdiffhomepage
path: root/cli-runopts.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli-runopts.c')
-rw-r--r--cli-runopts.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli-runopts.c b/cli-runopts.c
index 54d4875..d8eada7 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -358,8 +358,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) {
TRACE(("connectaddr == NULL"))
goto fail;
}
-
- connectaddr[0] = '\0';
+ *connectaddr = '\0';
connectaddr++;
connectport = strchr(connectaddr, ':');
@@ -367,8 +366,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) {
TRACE(("connectport == NULL"))
goto fail;
}
-
- connectport[0] = '\0';
+ *connectport = '\0';
connectport++;
newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList));
@@ -402,6 +400,8 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) {
newfwd->next = *fwdlist;
*fwdlist = newfwd;
+ m_free(str);
+
TRACE(("leave addforward: done"))
return;