diff options
Diffstat (limited to 'cli-runopts.c')
-rw-r--r-- | cli-runopts.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cli-runopts.c b/cli-runopts.c index 7a672da..1a077b9 100644 --- a/cli-runopts.c +++ b/cli-runopts.c @@ -363,7 +363,8 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) { TRACE(("enter addforward")) - /* We probably don't want to be editing argvs */ + /* We need to split the original argument up. This var + is never free()d. */ str = m_strdup(origstr); listenport = str; @@ -373,8 +374,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) { TRACE(("connectaddr == NULL")) goto fail; } - - connectaddr[0] = '\0'; + *connectaddr = '\0'; connectaddr++; connectport = strchr(connectaddr, ':'); @@ -382,8 +382,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)); |