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"))
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;