Fix socket leaks in wxFTP if starting up/downloading fails.
Add the missing delete statements. Closes #2250. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
446ff08ebb
commit
bffc6bc753
@ -769,7 +769,11 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
|
|||||||
|
|
||||||
wxString tmp_str = wxT("RETR ") + wxURI::Unescape(path);
|
wxString tmp_str = wxT("RETR ") + wxURI::Unescape(path);
|
||||||
if ( !CheckCommand(tmp_str, '1') )
|
if ( !CheckCommand(tmp_str, '1') )
|
||||||
|
{
|
||||||
|
delete sock;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sock = AcceptIfActive(sock);
|
sock = AcceptIfActive(sock);
|
||||||
if ( !sock )
|
if ( !sock )
|
||||||
@ -800,7 +804,11 @@ wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
|
|||||||
|
|
||||||
wxString tmp_str = wxT("STOR ") + path;
|
wxString tmp_str = wxT("STOR ") + path;
|
||||||
if ( !CheckCommand(tmp_str, '1') )
|
if ( !CheckCommand(tmp_str, '1') )
|
||||||
|
{
|
||||||
|
delete sock;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sock = AcceptIfActive(sock);
|
sock = AcceptIfActive(sock);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user