wininet: Don't release the parent object in FTP_Connect, the caller will do that.

This commit is contained in:
Hans Leidekker 2007-10-30 14:30:47 +02:00 committed by Alexandre Julliard
parent 5f5df83281
commit 1a8327468c
2 changed files with 9 additions and 8 deletions

View File

@ -2062,7 +2062,6 @@ lerror:
if (!bSuccess && handle)
{
WININET_Release( &hIC->hdr );
WININET_FreeHandle( handle );
handle = NULL;
}

View File

@ -668,19 +668,21 @@ START_TEST(ftp)
hInternet = InternetOpen("winetest", 0, NULL, NULL, 0);
ok(hInternet != NULL, "InternetOpen failed: %u\n", GetLastError());
SetLastError(0xdeadbeef);
hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "anonymous", NULL, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
ok(hFtp != NULL, "InternetOpen failed: %u\n", GetLastError());
SetLastError(0xdeadbeef);
hHttp = InternetConnect(hInternet, "www.winehq.org", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
ok(hFtp != NULL, "InternetOpen failed: %u\n", GetLastError());
if (!hFtp)
{
InternetCloseHandle(hInternet);
skip("No ftp connection could be made to ftp.winehq.org\n");
return;
}
hHttp = InternetConnect(hInternet, "www.winehq.org", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
if (!hHttp)
{
InternetCloseHandle(hFtp);
InternetCloseHandle(hInternet);
skip("No http connection could be made to www.winehq.org\n");
return;
}
/* The first call should always be a proper InternetOpen, if not
* several calls will return ERROR_INTERNET_NOT_INITIALIZED when