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:
Vadim Zeitlin 2014-07-13 13:53:06 +00:00
parent 446ff08ebb
commit bffc6bc753

View File

@ -769,7 +769,11 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path)
wxString tmp_str = wxT("RETR ") + wxURI::Unescape(path);
if ( !CheckCommand(tmp_str, '1') )
{
delete sock;
return NULL;
}
sock = AcceptIfActive(sock);
if ( !sock )
@ -800,7 +804,11 @@ wxOutputStream *wxFTP::GetOutputStream(const wxString& path)
wxString tmp_str = wxT("STOR ") + path;
if ( !CheckCommand(tmp_str, '1') )
{
delete sock;
return NULL;
}
sock = AcceptIfActive(sock);