Hans Leidekker : wininet: Properly clean up ftp sessions.
Alexandre Julliard
julliard at winehq.org
Mon Oct 22 09:55:28 CDT 2007
Module: wine
Branch: master
Commit: dd5347ee6af6335e311624aa565837c873097d5d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd5347ee6af6335e311624aa565837c873097d5d
Author: Hans Leidekker <hans at it.vu.nl>
Date: Sat Oct 20 21:15:18 2007 +0200
wininet: Properly clean up ftp sessions.
---
dlls/wininet/ftp.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 26b319e..637d193 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -2006,22 +2006,20 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
}
lerror:
- if (!bSuccess && nsocket != -1)
- closesocket(nsocket);
+ if (lpwfs) WININET_Release( &lpwfs->hdr );
- if (!bSuccess && lpwfs)
+ if (!bSuccess && handle)
{
- HeapFree(GetProcessHeap(), 0, lpwfs);
+ WININET_Release( &hIC->hdr );
WININET_FreeHandle( handle );
handle = NULL;
- lpwfs = NULL;
}
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
INTERNET_ASYNC_RESULT iar;
- iar.dwResult = (DWORD)lpwfs;
+ iar.dwResult = bSuccess ? (DWORD_PTR)lpwfs : 0;
iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError();
SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
&iar, sizeof(INTERNET_ASYNC_RESULT));
More information about the wine-cvs
mailing list