diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index 01a81059f95..ef1eef10962 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -1092,8 +1092,6 @@ static void FTPFILE_Destroy(WININETHANDLEHEADER *hdr) TRACE("\n"); - WININET_Release(&lpwh->lpFtpSession->hdr); - if (!lpwh->session_deleted) lpwfs->download_in_progress = NULL; @@ -1103,6 +1101,8 @@ static void FTPFILE_Destroy(WININETHANDLEHEADER *hdr) nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext); if (nResCode > 0 && nResCode != 226) WARN("server reports failed transfer\n"); + WININET_Release(&lpwh->lpFtpSession->hdr); + HeapFree(GetProcessHeap(), 0, lpwh); }