diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 0973522a46..dc159f5571 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -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);