mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 19:07:28 +00:00
Fix another leak found by Klocwork
--HG-- extra : convert_revision : f6ffa6544086d7088a04d6e94b3bfb1bfc67908d
This commit is contained in:
parent
d4bc0aec5d
commit
d2f292b3ad
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user