wininet: Properly clean up ftp sessions.
This commit is contained in:
parent
c33a51eaf2
commit
dd5347ee6a
@ -2006,22 +2006,20 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
lerror:
|
lerror:
|
||||||
if (!bSuccess && nsocket != -1)
|
if (lpwfs) WININET_Release( &lpwfs->hdr );
|
||||||
closesocket(nsocket);
|
|
||||||
|
|
||||||
if (!bSuccess && lpwfs)
|
if (!bSuccess && handle)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpwfs);
|
WININET_Release( &hIC->hdr );
|
||||||
WININET_FreeHandle( handle );
|
WININET_FreeHandle( handle );
|
||||||
handle = NULL;
|
handle = NULL;
|
||||||
lpwfs = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
|
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
|
||||||
{
|
{
|
||||||
INTERNET_ASYNC_RESULT iar;
|
INTERNET_ASYNC_RESULT iar;
|
||||||
|
|
||||||
iar.dwResult = (DWORD)lpwfs;
|
iar.dwResult = bSuccess ? (DWORD_PTR)lpwfs : 0;
|
||||||
iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError();
|
iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError();
|
||||||
SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
|
SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
|
||||||
&iar, sizeof(INTERNET_ASYNC_RESULT));
|
&iar, sizeof(INTERNET_ASYNC_RESULT));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user