mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 10:57:01 +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"))
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user