Hans Leidekker : wininet: Don't release the parent object in FTP_Connect, the caller will do that.
Alexandre Julliard
julliard at winehq.org
Tue Oct 30 08:32:51 CDT 2007
Module: wine
Branch: master
Commit: 1a8327468cc5e9c276711ef9e067582b50e05a43
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1a8327468cc5e9c276711ef9e067582b50e05a43
Author: Hans Leidekker <hans at it.vu.nl>
Date: Tue Oct 30 14:30:47 2007 +0200
wininet: Don't release the parent object in FTP_Connect, the caller will do that.
---
dlls/wininet/ftp.c | 1 -
dlls/wininet/tests/ftp.c | 16 +++++++++-------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 88d97ff..d763043 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -2062,7 +2062,6 @@ lerror:
if (!bSuccess && handle)
{
- WININET_Release( &hIC->hdr );
WININET_FreeHandle( handle );
handle = NULL;
}
diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c
index d5fe35c..7bbaf02 100644
--- a/dlls/wininet/tests/ftp.c
+++ b/dlls/wininet/tests/ftp.c
@@ -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
More information about the wine-cvs
mailing list