diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index f35929da0b3..cb24782fa4b 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -1552,6 +1552,7 @@ static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, &iar, sizeof(INTERNET_ASYNC_RESULT)); } + if (!bSuccess) DeleteFileW(lpszNewFile); return bSuccess; } diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c index 992bce99feb..34aa68fa1dd 100644 --- a/dlls/wininet/tests/ftp.c +++ b/dlls/wininet/tests/ftp.c @@ -259,7 +259,6 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect) ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR, "Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError()); /* Currently Wine always creates the local file (even on failure) which is not correct, hence the test */ - todo_wine ok (GetFileAttributesA("should_also_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES, "Local file should not have been created\n"); @@ -280,7 +279,6 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect) ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR, "Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError()); /* Currently Wine always creates the local file (even on failure) which is not correct, hence the test */ - todo_wine ok (GetFileAttributesA("should_also_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES, "Local file should not have been created\n");