Fix another leak found by Klocwork

--HG--
extra : convert_revision : f6ffa6544086d7088a04d6e94b3bfb1bfc67908d
This commit is contained in:
Matt Johnston 2007-02-03 13:50:47 +00:00
parent d4bc0aec5d
commit d2f292b3ad

View File

@ -358,8 +358,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) {
TRACE(("connectaddr == NULL")) TRACE(("connectaddr == NULL"))
goto fail; goto fail;
} }
*connectaddr = '\0';
connectaddr[0] = '\0';
connectaddr++; connectaddr++;
connectport = strchr(connectaddr, ':'); connectport = strchr(connectaddr, ':');
@ -367,8 +366,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) {
TRACE(("connectport == NULL")) TRACE(("connectport == NULL"))
goto fail; goto fail;
} }
*connectport = '\0';
connectport[0] = '\0';
connectport++; connectport++;
newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList)); newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList));
@ -402,6 +400,8 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) {
newfwd->next = *fwdlist; newfwd->next = *fwdlist;
*fwdlist = newfwd; *fwdlist = newfwd;
m_free(str);
TRACE(("leave addforward: done")) TRACE(("leave addforward: done"))
return; return;