wininet: Consistently use the allocation macros.
This commit is contained in:
parent
14d4d1957d
commit
9acd1ef15f
|
@ -132,14 +132,14 @@ static cookie *COOKIE_findCookie(cookie_domain *domain, LPCWSTR lpszCookieName)
|
|||
/* removes a cookie from the list, if its the last cookie we also remove the domain */
|
||||
static void COOKIE_deleteCookie(cookie *deadCookie, BOOL deleteDomain)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, deadCookie->lpCookieName);
|
||||
HeapFree(GetProcessHeap(), 0, deadCookie->lpCookieData);
|
||||
heap_free(deadCookie->lpCookieName);
|
||||
heap_free(deadCookie->lpCookieData);
|
||||
list_remove(&deadCookie->entry);
|
||||
|
||||
/* special case: last cookie, lets remove the domain to save memory */
|
||||
if (list_empty(&deadCookie->parent->cookie_list) && deleteDomain)
|
||||
COOKIE_deleteDomain(deadCookie->parent);
|
||||
HeapFree(GetProcessHeap(), 0, deadCookie);
|
||||
heap_free(deadCookie);
|
||||
}
|
||||
|
||||
/* allocates a domain and adds it to the end */
|
||||
|
@ -251,13 +251,12 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain)
|
|||
COOKIE_deleteCookie(LIST_ENTRY(cursor, cookie, entry), FALSE);
|
||||
list_remove(cursor);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, deadDomain->lpCookieDomain);
|
||||
HeapFree(GetProcessHeap(), 0, deadDomain->lpCookiePath);
|
||||
heap_free(deadDomain->lpCookieDomain);
|
||||
heap_free(deadDomain->lpCookiePath);
|
||||
|
||||
list_remove(&deadDomain->entry);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, deadDomain);
|
||||
heap_free(deadDomain);
|
||||
}
|
||||
|
||||
BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size)
|
||||
|
@ -406,11 +405,9 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
|
|||
lpCookieData, *lpdwSize, NULL, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, szCookieData );
|
||||
HeapFree( GetProcessHeap(), 0, name );
|
||||
HeapFree( GetProcessHeap(), 0, url );
|
||||
|
||||
heap_free( szCookieData );
|
||||
heap_free( name );
|
||||
heap_free( url );
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -447,12 +444,11 @@ BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cooki
|
|||
if (!(ptr = strchrW(ptr,';'))) break;
|
||||
*ptr++ = 0;
|
||||
|
||||
if (value != data)
|
||||
HeapFree(GetProcessHeap(), 0, value);
|
||||
if (value != data) heap_free(value);
|
||||
value = heap_alloc((ptr - data) * sizeof(WCHAR));
|
||||
if (value == NULL)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, data);
|
||||
heap_free(data);
|
||||
ERR("could not allocate the cookie value buffer\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -521,8 +517,8 @@ BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cooki
|
|||
thisCookieDomain = COOKIE_addDomain(domain, path);
|
||||
else
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0,data);
|
||||
if (value != data) HeapFree(GetProcessHeap(), 0, value);
|
||||
heap_free(data);
|
||||
if (value != data) heap_free(value);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -535,13 +531,12 @@ BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cooki
|
|||
|
||||
if (!expired && !COOKIE_addCookie(thisCookieDomain, cookie_name, value, expiry))
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0,data);
|
||||
if (value != data) HeapFree(GetProcessHeap(), 0, value);
|
||||
heap_free(data);
|
||||
if (value != data) heap_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),0,data);
|
||||
if (value != data) HeapFree(GetProcessHeap(), 0, value);
|
||||
heap_free(data);
|
||||
if (value != data) heap_free(value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -593,7 +588,7 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
|
|||
|
||||
ret = set_cookie(hostName, path, cookie, data);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, cookie);
|
||||
heap_free(cookie);
|
||||
return ret;
|
||||
}
|
||||
return set_cookie(hostName, path, lpszCookieName, lpCookieData);
|
||||
|
@ -625,10 +620,9 @@ BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
|
|||
|
||||
r = InternetSetCookieW( url, name, data );
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, data );
|
||||
HeapFree( GetProcessHeap(), 0, name );
|
||||
HeapFree( GetProcessHeap(), 0, url );
|
||||
|
||||
heap_free( data );
|
||||
heap_free( name );
|
||||
heap_free( url );
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ static BOOL WININET_SetAuthorization( HINTERNET hRequest, LPWSTR username,
|
|||
q = heap_strdupW(password);
|
||||
if( !q )
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, username);
|
||||
heap_free(username);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -272,18 +272,18 @@ static BOOL WININET_SetAuthorization( HINTERNET hRequest, LPWSTR username,
|
|||
{
|
||||
appinfo_t *hIC = session->appInfo;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, hIC->proxyUsername);
|
||||
heap_free(hIC->proxyUsername);
|
||||
hIC->proxyUsername = p;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, hIC->proxyPassword);
|
||||
heap_free(hIC->proxyPassword);
|
||||
hIC->proxyPassword = q;
|
||||
}
|
||||
else
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, session->userName);
|
||||
heap_free(session->userName);
|
||||
session->userName = p;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, session->password);
|
||||
heap_free(session->password);
|
||||
session->password = q;
|
||||
}
|
||||
|
||||
|
|
|
@ -246,8 +246,8 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
|
|||
lpwzNewRemoteFile = heap_strdupAtoW(lpszNewRemoteFile);
|
||||
ret = FtpPutFileW(hConnect, lpwzLocalFile, lpwzNewRemoteFile,
|
||||
dwFlags, dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzLocalFile);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzNewRemoteFile);
|
||||
heap_free(lpwzLocalFile);
|
||||
heap_free(lpwzNewRemoteFile);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -261,8 +261,8 @@ static void AsyncFtpPutFileProc(WORKREQUEST *workRequest)
|
|||
FTP_FtpPutFileW(lpwfs, req->lpszLocalFile,
|
||||
req->lpszNewRemoteFile, req->dwFlags, req->dwContext);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszLocalFile);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszNewRemoteFile);
|
||||
heap_free(req->lpszLocalFile);
|
||||
heap_free(req->lpszNewRemoteFile);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -432,7 +432,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
|
|||
|
||||
lpwzDirectory = heap_strdupAtoW(lpszDirectory);
|
||||
ret = FtpSetCurrentDirectoryW(hConnect, lpwzDirectory);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzDirectory);
|
||||
heap_free(lpwzDirectory);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -445,7 +445,7 @@ static void AsyncFtpSetCurrentDirectoryProc(WORKREQUEST *workRequest)
|
|||
TRACE("%p\n", lpwfs);
|
||||
|
||||
FTP_FtpSetCurrentDirectoryW(lpwfs, req->lpszDirectory);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszDirectory);
|
||||
heap_free(req->lpszDirectory);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -578,7 +578,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
|
|||
|
||||
lpwzDirectory = heap_strdupAtoW(lpszDirectory);
|
||||
ret = FtpCreateDirectoryW(hConnect, lpwzDirectory);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzDirectory);
|
||||
heap_free(lpwzDirectory);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -591,7 +591,7 @@ static void AsyncFtpCreateDirectoryProc(WORKREQUEST *workRequest)
|
|||
TRACE(" %p\n", lpwfs);
|
||||
|
||||
FTP_FtpCreateDirectoryW(lpwfs, req->lpszDirectory);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszDirectory);
|
||||
heap_free(req->lpszDirectory);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -728,7 +728,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
|
|||
lpwzSearchFile = heap_strdupAtoW(lpszSearchFile);
|
||||
lpFindFileDataW = lpFindFileData?&wfd:NULL;
|
||||
ret = FtpFindFirstFileW(hConnect, lpwzSearchFile, lpFindFileDataW, dwFlags, dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzSearchFile);
|
||||
heap_free(lpwzSearchFile);
|
||||
|
||||
if (ret && lpFindFileData)
|
||||
WININET_find_data_WtoA(lpFindFileDataW, lpFindFileData);
|
||||
|
@ -746,7 +746,7 @@ static void AsyncFtpFindFirstFileProc(WORKREQUEST *workRequest)
|
|||
|
||||
FTP_FtpFindFirstFileW(lpwfs, req->lpszSearchFile,
|
||||
req->lpFindFileData, req->dwFlags, req->dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszSearchFile);
|
||||
heap_free(req->lpszSearchFile);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -930,7 +930,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire
|
|||
WideCharToMultiByte(CP_ACP, 0, dir, -1, lpszCurrentDirectory, len, NULL, NULL);
|
||||
|
||||
if (lpdwCurrentDirectory) *lpdwCurrentDirectory = len;
|
||||
HeapFree(GetProcessHeap(), 0, dir);
|
||||
heap_free(dir);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1076,7 +1076,7 @@ static BOOL FTP_FtpGetCurrentDirectoryW(ftp_session_t *lpwfs, LPWSTR lpszCurrent
|
|||
}
|
||||
else INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpszResponseBuffer);
|
||||
heap_free(lpszResponseBuffer);
|
||||
}
|
||||
else
|
||||
FTP_SetResponseError(nResCode);
|
||||
|
@ -1115,7 +1115,7 @@ static void FTPFILE_Destroy(object_header_t *hdr)
|
|||
if (lpwh->cache_file_handle != INVALID_HANDLE_VALUE)
|
||||
CloseHandle(lpwh->cache_file_handle);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpwh->cache_file);
|
||||
heap_free(lpwh->cache_file);
|
||||
|
||||
if (!lpwh->session_deleted)
|
||||
lpwfs->download_in_progress = NULL;
|
||||
|
@ -1393,13 +1393,13 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
|
|||
if (lpwh->cache_file_handle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
WARN("Could not create cache file: %u\n", GetLastError());
|
||||
HeapFree(GetProcessHeap(), 0, lpwh->cache_file);
|
||||
heap_free(lpwh->cache_file);
|
||||
lpwh->cache_file = NULL;
|
||||
}
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, url);
|
||||
heap_free(url);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, uc.lpszUrlPath);
|
||||
heap_free(uc.lpszUrlPath);
|
||||
}
|
||||
|
||||
hIC = lpwfs->lpAppInfo;
|
||||
|
@ -1454,7 +1454,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession,
|
|||
|
||||
lpwzFileName = heap_strdupAtoW(lpszFileName);
|
||||
ret = FtpOpenFileW(hFtpSession, lpwzFileName, fdwAccess, dwFlags, dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzFileName);
|
||||
heap_free(lpwzFileName);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1468,7 +1468,7 @@ static void AsyncFtpOpenFileProc(WORKREQUEST *workRequest)
|
|||
|
||||
FTP_FtpOpenFileW(lpwfs, req->lpszFilename,
|
||||
req->dwAccess, req->dwFlags, req->dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszFilename);
|
||||
heap_free(req->lpszFilename);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1570,8 +1570,8 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
|
|||
lpwzNewFile = heap_strdupAtoW(lpszNewFile);
|
||||
ret = FtpGetFileW(hInternet, lpwzRemoteFile, lpwzNewFile, fFailIfExists,
|
||||
dwLocalFlagsAttribute, dwInternetFlags, dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzRemoteFile);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzNewFile);
|
||||
heap_free(lpwzRemoteFile);
|
||||
heap_free(lpwzNewFile);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1586,8 +1586,8 @@ static void AsyncFtpGetFileProc(WORKREQUEST *workRequest)
|
|||
FTP_FtpGetFileW(lpwfs, req->lpszRemoteFile,
|
||||
req->lpszNewFile, req->fFailIfExists,
|
||||
req->dwLocalFlagsAttribute, req->dwFlags, req->dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszRemoteFile);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszNewFile);
|
||||
heap_free(req->lpszRemoteFile);
|
||||
heap_free(req->lpszNewFile);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1778,7 +1778,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
|
|||
|
||||
lpwzFileName = heap_strdupAtoW(lpszFileName);
|
||||
ret = FtpDeleteFileW(hFtpSession, lpwzFileName);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzFileName);
|
||||
heap_free(lpwzFileName);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1790,7 +1790,7 @@ static void AsyncFtpDeleteFileProc(WORKREQUEST *workRequest)
|
|||
TRACE("%p\n", lpwfs);
|
||||
|
||||
FTP_FtpDeleteFileW(lpwfs, req->lpszFilename);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszFilename);
|
||||
heap_free(req->lpszFilename);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1923,7 +1923,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
|
|||
|
||||
lpwzDirectory = heap_strdupAtoW(lpszDirectory);
|
||||
ret = FtpRemoveDirectoryW(hFtpSession, lpwzDirectory);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzDirectory);
|
||||
heap_free(lpwzDirectory);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1935,7 +1935,7 @@ static void AsyncFtpRemoveDirectoryProc(WORKREQUEST *workRequest)
|
|||
TRACE("%p\n", lpwfs);
|
||||
|
||||
FTP_FtpRemoveDirectoryW(lpwfs, req->lpszDirectory);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszDirectory);
|
||||
heap_free(req->lpszDirectory);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -2071,8 +2071,8 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes
|
|||
lpwzSrc = heap_strdupAtoW(lpszSrc);
|
||||
lpwzDest = heap_strdupAtoW(lpszDest);
|
||||
ret = FtpRenameFileW(hFtpSession, lpwzSrc, lpwzDest);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzSrc);
|
||||
HeapFree(GetProcessHeap(), 0, lpwzDest);
|
||||
heap_free(lpwzSrc);
|
||||
heap_free(lpwzDest);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2084,8 +2084,8 @@ static void AsyncFtpRenameFileProc(WORKREQUEST *workRequest)
|
|||
TRACE("%p\n", lpwfs);
|
||||
|
||||
FTP_FtpRenameFileW(lpwfs, req->lpszSrcFile, req->lpszDestFile);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszSrcFile);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszDestFile);
|
||||
heap_free(req->lpszSrcFile);
|
||||
heap_free(req->lpszDestFile);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -2239,7 +2239,7 @@ BOOL WINAPI FtpCommandA( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags
|
|||
|
||||
r = FtpCommandW(hConnect, fExpectResponse, dwFlags, cmdW, dwContext, phFtpCommand);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, cmdW);
|
||||
heap_free(cmdW);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -2323,7 +2323,7 @@ BOOL WINAPI FtpCommandW( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags
|
|||
|
||||
lend:
|
||||
WININET_Release( &lpwfs->hdr );
|
||||
HeapFree(GetProcessHeap(), 0, cmd);
|
||||
heap_free( cmd );
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -2341,9 +2341,9 @@ static void FTPSESSION_Destroy(object_header_t *hdr)
|
|||
|
||||
WININET_Release(&lpwfs->lpAppInfo->hdr);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpwfs->lpszPassword);
|
||||
HeapFree(GetProcessHeap(), 0, lpwfs->lpszUserName);
|
||||
HeapFree(GetProcessHeap(), 0, lpwfs->servername);
|
||||
heap_free(lpwfs->lpszPassword);
|
||||
heap_free(lpwfs->lpszUserName);
|
||||
heap_free(lpwfs->servername);
|
||||
}
|
||||
|
||||
static void FTPSESSION_CloseConnection(object_header_t *hdr)
|
||||
|
@ -2674,8 +2674,7 @@ static BOOL FTP_SendCommandA(INT nSocket, FTP_COMMAND ftpCmd, LPCSTR lpszParam,
|
|||
nRC = send(nSocket, buf+nBytesSent, len - nBytesSent, 0);
|
||||
nBytesSent += nRC;
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, (LPVOID)buf);
|
||||
heap_free(buf);
|
||||
|
||||
if (lpfnStatusCB)
|
||||
{
|
||||
|
@ -2703,7 +2702,7 @@ static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam,
|
|||
BOOL ret;
|
||||
LPSTR lpszParamA = heap_strdupWtoA(lpszParam);
|
||||
ret = FTP_SendCommandA(nSocket, ftpCmd, lpszParamA, lpfnStatusCB, hdr, dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, lpszParamA);
|
||||
heap_free(lpszParamA);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3279,8 +3278,7 @@ static BOOL FTP_SendData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE hFile)
|
|||
|
||||
TRACE("file transfer complete!\n");
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpszBuffer);
|
||||
|
||||
heap_free(lpszBuffer);
|
||||
return nTotalSent;
|
||||
}
|
||||
|
||||
|
@ -3371,9 +3369,8 @@ static BOOL FTP_RetrieveFileData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE h
|
|||
TRACE("Data transfer complete\n");
|
||||
|
||||
recv_end:
|
||||
HeapFree(GetProcessHeap(), 0, lpszBuffer);
|
||||
|
||||
return (nRC != -1);
|
||||
heap_free(lpszBuffer);
|
||||
return (nRC != -1);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -3392,10 +3389,9 @@ static void FTPFINDNEXT_Destroy(object_header_t *hdr)
|
|||
|
||||
for (i = 0; i < lpwfn->size; i++)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpwfn->lpafp[i].lpszName);
|
||||
heap_free(lpwfn->lpafp[i].lpszName);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpwfn->lpafp);
|
||||
heap_free(lpwfn->lpafp);
|
||||
}
|
||||
|
||||
static DWORD FTPFINDNEXT_FindNextFileProc(WININETFTPFINDNEXTW *find, LPVOID data)
|
||||
|
@ -3725,7 +3721,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
|
|||
TRACE("Matched: %s\n", debugstr_w(lpfp->lpszName));
|
||||
}
|
||||
else {
|
||||
HeapFree(GetProcessHeap(), 0, lpfp->lpszName);
|
||||
heap_free(lpfp->lpszName);
|
||||
lpfp->lpszName = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -3788,7 +3784,7 @@ static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSe
|
|||
}
|
||||
else
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, *lpafp);
|
||||
heap_free(*lpafp);
|
||||
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
|
||||
bSuccess = FALSE;
|
||||
}
|
||||
|
|
|
@ -506,7 +506,7 @@ static voidpf wininet_zalloc(voidpf opaque, uInt items, uInt size)
|
|||
|
||||
static void wininet_zfree(voidpf opaque, voidpf address)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, address);
|
||||
heap_free(address);
|
||||
}
|
||||
|
||||
static DWORD init_gzip_stream(http_request_t *req)
|
||||
|
@ -525,7 +525,7 @@ static DWORD init_gzip_stream(http_request_t *req)
|
|||
zres = inflateInit2(&gzip_stream->zstream, 0x1f);
|
||||
if(zres != Z_OK) {
|
||||
ERR("inflateInit failed: %d\n", zres);
|
||||
HeapFree(GetProcessHeap(), 0, gzip_stream);
|
||||
heap_free(gzip_stream);
|
||||
return ERROR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
|
@ -615,9 +615,8 @@ static LPWSTR * HTTP_Tokenize(LPCWSTR string, LPCWSTR token_string)
|
|||
static void HTTP_FreeTokens(LPWSTR * token_array)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; token_array[i]; i++)
|
||||
HeapFree(GetProcessHeap(), 0, token_array[i]);
|
||||
HeapFree(GetProcessHeap(), 0, token_array);
|
||||
for (i = 0; token_array[i]; i++) heap_free(token_array[i]);
|
||||
heap_free(token_array);
|
||||
}
|
||||
|
||||
static void HTTP_FixURL(http_request_t *request)
|
||||
|
@ -650,7 +649,7 @@ static void HTTP_FixURL(http_request_t *request)
|
|||
WCHAR *fixurl = heap_alloc((strlenW(request->path) + 2)*sizeof(WCHAR));
|
||||
*fixurl = '/';
|
||||
strcpyW(fixurl + 1, request->path);
|
||||
HeapFree( GetProcessHeap(), 0, request->path );
|
||||
heap_free( request->path );
|
||||
request->path = fixurl;
|
||||
}
|
||||
}
|
||||
|
@ -700,7 +699,7 @@ static LPWSTR HTTP_BuildHeaderRequestString( http_request_t *request, LPCWSTR ve
|
|||
|
||||
req[n] = NULL;
|
||||
requestString = HTTP_build_req( req, 4 );
|
||||
HeapFree( GetProcessHeap(), 0, req );
|
||||
heap_free( req );
|
||||
|
||||
/*
|
||||
* Set (header) termination string for request
|
||||
|
@ -816,9 +815,9 @@ static void destroy_authinfo( struct HttpAuthInfo *authinfo )
|
|||
if (SecIsValidHandle(&authinfo->cred))
|
||||
FreeCredentialsHandle(&authinfo->cred);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, authinfo->auth_data);
|
||||
HeapFree(GetProcessHeap(), 0, authinfo->scheme);
|
||||
HeapFree(GetProcessHeap(), 0, authinfo);
|
||||
heap_free(authinfo->auth_data);
|
||||
heap_free(authinfo->scheme);
|
||||
heap_free(authinfo);
|
||||
}
|
||||
|
||||
static UINT retrieve_cached_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR *auth_data)
|
||||
|
@ -865,7 +864,7 @@ static void cache_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR auth_data
|
|||
if (ad)
|
||||
{
|
||||
TRACE("Found match in cache, replacing\n");
|
||||
HeapFree(GetProcessHeap(),0,ad->authorization);
|
||||
heap_free(ad->authorization);
|
||||
ad->authorization = heap_alloc(auth_data_len);
|
||||
memcpy(ad->authorization, auth_data, auth_data_len);
|
||||
ad->authorizationLen = auth_data_len;
|
||||
|
@ -901,9 +900,9 @@ static BOOL retrieve_cached_authorization(LPWSTR host, LPWSTR scheme,
|
|||
nt_auth_identity->Domain = heap_alloc(sizeof(WCHAR)*ad->domain_len);
|
||||
if(!nt_auth_identity->User || !nt_auth_identity->Password ||
|
||||
(!nt_auth_identity->Domain && ad->domain_len)) {
|
||||
HeapFree(GetProcessHeap(), 0, nt_auth_identity->User);
|
||||
HeapFree(GetProcessHeap(), 0, nt_auth_identity->Password);
|
||||
HeapFree(GetProcessHeap(), 0, nt_auth_identity->Domain);
|
||||
heap_free(nt_auth_identity->User);
|
||||
heap_free(nt_auth_identity->Password);
|
||||
heap_free(nt_auth_identity->Domain);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -937,9 +936,9 @@ static void cache_authorization(LPWSTR host, LPWSTR scheme,
|
|||
}
|
||||
|
||||
if(found) {
|
||||
HeapFree(GetProcessHeap(), 0, ad->user);
|
||||
HeapFree(GetProcessHeap(), 0, ad->password);
|
||||
HeapFree(GetProcessHeap(), 0, ad->domain);
|
||||
heap_free(ad->user);
|
||||
heap_free(ad->password);
|
||||
heap_free(ad->domain);
|
||||
} else {
|
||||
ad = heap_alloc(sizeof(authorizationData));
|
||||
if(!ad) {
|
||||
|
@ -961,13 +960,13 @@ static void cache_authorization(LPWSTR host, LPWSTR scheme,
|
|||
|
||||
if(!ad->host || !ad->scheme || !ad->user || !ad->password
|
||||
|| (nt_auth_identity->Domain && !ad->domain)) {
|
||||
HeapFree(GetProcessHeap(), 0, ad->host);
|
||||
HeapFree(GetProcessHeap(), 0, ad->scheme);
|
||||
HeapFree(GetProcessHeap(), 0, ad->user);
|
||||
HeapFree(GetProcessHeap(), 0, ad->password);
|
||||
HeapFree(GetProcessHeap(), 0, ad->domain);
|
||||
heap_free(ad->host);
|
||||
heap_free(ad->scheme);
|
||||
heap_free(ad->user);
|
||||
heap_free(ad->password);
|
||||
heap_free(ad->domain);
|
||||
list_remove(&ad->entry);
|
||||
HeapFree(GetProcessHeap(), 0, ad);
|
||||
heap_free(ad);
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&authcache_cs);
|
||||
|
@ -1008,7 +1007,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
pAuthInfo->scheme = heap_strdupW(szBasic);
|
||||
if (!pAuthInfo->scheme)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pAuthInfo);
|
||||
heap_free(pAuthInfo);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1020,7 +1019,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
pAuthInfo->scheme = heap_strdupW(pszAuthValue);
|
||||
if (!pAuthInfo->scheme)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pAuthInfo);
|
||||
heap_free(pAuthInfo);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1063,9 +1062,9 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
&exp);
|
||||
|
||||
if(pAuthData && !domain_and_username) {
|
||||
HeapFree(GetProcessHeap(), 0, nt_auth_identity.User);
|
||||
HeapFree(GetProcessHeap(), 0, nt_auth_identity.Domain);
|
||||
HeapFree(GetProcessHeap(), 0, nt_auth_identity.Password);
|
||||
heap_free(nt_auth_identity.User);
|
||||
heap_free(nt_auth_identity.Domain);
|
||||
heap_free(nt_auth_identity.Password);
|
||||
}
|
||||
|
||||
if (sec_status == SEC_E_OK)
|
||||
|
@ -1082,8 +1081,8 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
{
|
||||
WARN("AcquireCredentialsHandleW for scheme %s failed with error 0x%08x\n",
|
||||
debugstr_w(pAuthInfo->scheme), sec_status);
|
||||
HeapFree(GetProcessHeap(), 0, pAuthInfo->scheme);
|
||||
HeapFree(GetProcessHeap(), 0, pAuthInfo);
|
||||
heap_free(pAuthInfo->scheme);
|
||||
heap_free(pAuthInfo);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1115,7 +1114,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
auth_data_len = retrieve_cached_basic_authorization(host, szRealm,&auth_data);
|
||||
if (auth_data_len == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0,szRealm);
|
||||
heap_free(szRealm);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1128,7 +1127,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
auth_data = heap_alloc(userlen + 1 + passlen);
|
||||
if (!auth_data)
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0,szRealm);
|
||||
heap_free(szRealm);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1143,8 +1142,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
pAuthInfo->auth_data = auth_data;
|
||||
pAuthInfo->auth_data_len = auth_data_len;
|
||||
pAuthInfo->finished = TRUE;
|
||||
HeapFree(GetProcessHeap(),0,szRealm);
|
||||
|
||||
heap_free(szRealm);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
|
@ -1206,7 +1204,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *request, LPCWSTR pszAuthValue,
|
|||
else
|
||||
{
|
||||
ERR("InitializeSecurityContextW returned error 0x%08x\n", sec_status);
|
||||
HeapFree(GetProcessHeap(), 0, out.pvBuffer);
|
||||
heap_free(out.pvBuffer);
|
||||
destroy_authinfo(pAuthInfo);
|
||||
*ppAuthInfo = NULL;
|
||||
return FALSE;
|
||||
|
@ -1280,8 +1278,7 @@ static DWORD HTTP_HttpAddRequestHeadersW(http_request_t *request,
|
|||
lpszStart = lpszEnd;
|
||||
} while (res == ERROR_SUCCESS);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
|
||||
heap_free(buffer);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -1350,8 +1347,7 @@ BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest,
|
|||
|
||||
r = HttpAddRequestHeadersW( hHttpRequest, hdr, dwHeaderLength, dwModifier );
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, hdr );
|
||||
|
||||
heap_free( hdr );
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -1463,16 +1459,15 @@ end:
|
|||
acceptTypesCount = 0;
|
||||
while (szAcceptTypes[acceptTypesCount])
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, szAcceptTypes[acceptTypesCount]);
|
||||
heap_free(szAcceptTypes[acceptTypesCount]);
|
||||
acceptTypesCount++;
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, szAcceptTypes);
|
||||
heap_free(szAcceptTypes);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, szReferrer);
|
||||
HeapFree(GetProcessHeap(), 0, szVersion);
|
||||
HeapFree(GetProcessHeap(), 0, szObjectName);
|
||||
HeapFree(GetProcessHeap(), 0, szVerb);
|
||||
|
||||
heap_free(szReferrer);
|
||||
heap_free(szVersion);
|
||||
heap_free(szObjectName);
|
||||
heap_free(szVerb);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1641,7 +1636,7 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn
|
|||
* connection tracking */
|
||||
if (strcmpiW(pAuthInfo->scheme, wszBasic))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pAuthInfo->auth_data);
|
||||
heap_free(pAuthInfo->auth_data);
|
||||
pAuthInfo->auth_data = NULL;
|
||||
pAuthInfo->auth_data_len = 0;
|
||||
}
|
||||
|
@ -1650,8 +1645,7 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn
|
|||
TRACE("Inserting authorization: %s\n", debugstr_w(authorization));
|
||||
|
||||
HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, authorization);
|
||||
heap_free(authorization);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1728,7 +1722,7 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
|
|||
if(UrlComponents.nPort == INTERNET_INVALID_PORT_NUMBER)
|
||||
UrlComponents.nPort = INTERNET_DEFAULT_HTTP_PORT;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, session->serverName);
|
||||
heap_free(session->serverName);
|
||||
session->serverName = heap_strdupW(UrlComponents.lpszHostName);
|
||||
session->serverPort = UrlComponents.nPort;
|
||||
|
||||
|
@ -1827,8 +1821,7 @@ static void HTTPREQ_Destroy(object_header_t *hdr)
|
|||
request->rawHeaders, headersLen, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->cacheFile);
|
||||
heap_free(request->cacheFile);
|
||||
|
||||
DeleteCriticalSection( &request->read_section );
|
||||
WININET_Release(&request->session->hdr);
|
||||
|
@ -1836,20 +1829,19 @@ static void HTTPREQ_Destroy(object_header_t *hdr)
|
|||
destroy_authinfo(request->authInfo);
|
||||
destroy_authinfo(request->proxyAuthInfo);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->path);
|
||||
HeapFree(GetProcessHeap(), 0, request->verb);
|
||||
HeapFree(GetProcessHeap(), 0, request->rawHeaders);
|
||||
HeapFree(GetProcessHeap(), 0, request->version);
|
||||
HeapFree(GetProcessHeap(), 0, request->statusText);
|
||||
heap_free(request->path);
|
||||
heap_free(request->verb);
|
||||
heap_free(request->rawHeaders);
|
||||
heap_free(request->version);
|
||||
heap_free(request->statusText);
|
||||
|
||||
for (i = 0; i < request->nCustHeaders; i++)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, request->custHeaders[i].lpszField);
|
||||
HeapFree(GetProcessHeap(), 0, request->custHeaders[i].lpszValue);
|
||||
heap_free(request->custHeaders[i].lpszField);
|
||||
heap_free(request->custHeaders[i].lpszValue);
|
||||
}
|
||||
|
||||
destroy_data_stream(request->data_stream);
|
||||
HeapFree(GetProcessHeap(), 0, request->custHeaders);
|
||||
heap_free(request->custHeaders);
|
||||
}
|
||||
|
||||
static void http_release_netconn(http_request_t *req, BOOL reuse)
|
||||
|
@ -2083,7 +2075,7 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
|
|||
ts->ftExpires = info->ExpireTime;
|
||||
ts->ftLastModified = info->LastModifiedTime;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, info);
|
||||
heap_free(info);
|
||||
*size = sizeof(*ts);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
@ -2193,12 +2185,12 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer,
|
|||
*(DWORD*)buffer);
|
||||
|
||||
case INTERNET_OPTION_USERNAME:
|
||||
HeapFree(GetProcessHeap(), 0, req->session->userName);
|
||||
heap_free(req->session->userName);
|
||||
if (!(req->session->userName = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY;
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
case INTERNET_OPTION_PASSWORD:
|
||||
HeapFree(GetProcessHeap(), 0, req->session->password);
|
||||
heap_free(req->session->password);
|
||||
if (!(req->session->password = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY;
|
||||
return ERROR_SUCCESS;
|
||||
case INTERNET_OPTION_HTTP_DECODING:
|
||||
|
@ -3342,8 +3334,7 @@ static DWORD HTTP_HttpQueryInfoW(http_request_t *request, DWORD dwInfoLevel,
|
|||
}
|
||||
*lpdwBufferLength = len;
|
||||
|
||||
if (request_only)
|
||||
HeapFree(GetProcessHeap(), 0, headers);
|
||||
if (request_only) heap_free(headers);
|
||||
return res;
|
||||
}
|
||||
case HTTP_QUERY_RAW_HEADERS:
|
||||
|
@ -3696,8 +3687,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel,
|
|||
* the Unicode characters can be reduced to a single byte */
|
||||
*lpdwBufferLength = len / sizeof(WCHAR);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, bufferW );
|
||||
|
||||
heap_free( bufferW );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -3739,7 +3729,7 @@ static LPWSTR HTTP_GetRedirectURL(http_request_t *request, LPCWSTR lpszUrl)
|
|||
url_length = url_length / sizeof(WCHAR) - 1;
|
||||
if (!InternetCreateUrlW(&urlComponents, 0, orig_url, &url_length))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, orig_url);
|
||||
heap_free(orig_url);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -3747,18 +3737,18 @@ static LPWSTR HTTP_GetRedirectURL(http_request_t *request, LPCWSTR lpszUrl)
|
|||
if (!InternetCombineUrlW(orig_url, lpszUrl, NULL, &url_length, ICU_ENCODE_SPACES_ONLY) &&
|
||||
(GetLastError() != ERROR_INSUFFICIENT_BUFFER))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, orig_url);
|
||||
heap_free(orig_url);
|
||||
return NULL;
|
||||
}
|
||||
combined_url = heap_alloc(url_length * sizeof(WCHAR));
|
||||
|
||||
if (!InternetCombineUrlW(orig_url, lpszUrl, combined_url, &url_length, ICU_ENCODE_SPACES_ONLY))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, orig_url);
|
||||
HeapFree(GetProcessHeap(), 0, combined_url);
|
||||
heap_free(orig_url);
|
||||
heap_free(combined_url);
|
||||
return NULL;
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, orig_url);
|
||||
heap_free(orig_url);
|
||||
return combined_url;
|
||||
}
|
||||
|
||||
|
@ -3846,7 +3836,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
|
|||
HTTP_ADDHDR_FLAG_ADD_IF_NEW);
|
||||
#endif
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, session->hostName);
|
||||
heap_free(session->hostName);
|
||||
if (urlComponents.nPort != INTERNET_DEFAULT_HTTP_PORT &&
|
||||
urlComponents.nPort != INTERNET_DEFAULT_HTTPS_PORT)
|
||||
{
|
||||
|
@ -3862,7 +3852,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
|
|||
|
||||
HTTP_ProcessHeader(request, hostW, session->hostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, session->userName);
|
||||
heap_free(session->userName);
|
||||
session->userName = NULL;
|
||||
if (userName[0])
|
||||
session->userName = heap_strdupW(userName);
|
||||
|
@ -3871,14 +3861,13 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
|
|||
|
||||
if(!using_proxy) {
|
||||
if(strcmpiW(session->serverName, hostName)) {
|
||||
HeapFree(GetProcessHeap(), 0, session->serverName);
|
||||
heap_free(session->serverName);
|
||||
session->serverName = heap_strdupW(hostName);
|
||||
}
|
||||
session->serverPort = urlComponents.nPort;
|
||||
}
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->path);
|
||||
heap_free(request->path);
|
||||
request->path=NULL;
|
||||
if (*path)
|
||||
{
|
||||
|
@ -3950,20 +3939,19 @@ static DWORD HTTP_SecureProxyConnect(http_request_t *request)
|
|||
lpszPath = heap_alloc((lstrlenW( session->hostName ) + 13)*sizeof(WCHAR));
|
||||
sprintfW( lpszPath, szFormat, session->hostName, session->hostPort );
|
||||
requestString = HTTP_BuildHeaderRequestString( request, szConnect, lpszPath, g_szHttp1_1 );
|
||||
HeapFree( GetProcessHeap(), 0, lpszPath );
|
||||
heap_free( lpszPath );
|
||||
|
||||
len = WideCharToMultiByte( CP_ACP, 0, requestString, -1,
|
||||
NULL, 0, NULL, NULL );
|
||||
len--; /* the nul terminator isn't needed */
|
||||
ascii_req = heap_alloc(len);
|
||||
WideCharToMultiByte( CP_ACP, 0, requestString, -1,
|
||||
ascii_req, len, NULL, NULL );
|
||||
HeapFree( GetProcessHeap(), 0, requestString );
|
||||
WideCharToMultiByte( CP_ACP, 0, requestString, -1, ascii_req, len, NULL, NULL );
|
||||
heap_free( requestString );
|
||||
|
||||
TRACE("full request -> %s\n", debugstr_an( ascii_req, len ) );
|
||||
|
||||
res = NETCON_send( request->netconn, ascii_req, len, 0, &cnt );
|
||||
HeapFree( GetProcessHeap(), 0, ascii_req );
|
||||
heap_free( ascii_req );
|
||||
if (res != ERROR_SUCCESS)
|
||||
return res;
|
||||
|
||||
|
@ -4418,7 +4406,7 @@ static void HTTP_CacheRequest(http_request_t *request)
|
|||
|
||||
b = CreateUrlCacheEntryW(url, request->contentLength, NULL, cacheFileName, 0);
|
||||
if(b) {
|
||||
HeapFree(GetProcessHeap(), 0, request->cacheFile);
|
||||
heap_free(request->cacheFile);
|
||||
CloseHandle(request->hCacheFile);
|
||||
|
||||
request->cacheFile = heap_strdupW(cacheFileName);
|
||||
|
@ -4583,7 +4571,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
sprintfW(agent_header, user_agent, request->session->appInfo->agent);
|
||||
|
||||
HTTP_HttpAddRequestHeadersW(request, agent_header, strlenW(agent_header), HTTP_ADDREQ_FLAG_ADD_IF_NEW);
|
||||
HeapFree(GetProcessHeap(), 0, agent_header);
|
||||
heap_free(agent_header);
|
||||
}
|
||||
if (request->hdr.dwFlags & INTERNET_FLAG_PRAGMA_NOCACHE)
|
||||
{
|
||||
|
@ -4641,7 +4629,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
{
|
||||
WCHAR *url = HTTP_BuildProxyRequestUrl(request);
|
||||
requestString = HTTP_BuildHeaderRequestString(request, request->verb, url, request->version);
|
||||
HeapFree(GetProcessHeap(), 0, url);
|
||||
heap_free(url);
|
||||
}
|
||||
else
|
||||
requestString = HTTP_BuildHeaderRequestString(request, request->verb, request->path, request->version);
|
||||
|
@ -4670,7 +4658,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
INTERNET_STATUS_SENDING_REQUEST, NULL, 0);
|
||||
|
||||
res = NETCON_send(request->netconn, ascii_req, len, 0, &cnt);
|
||||
HeapFree( GetProcessHeap(), 0, ascii_req );
|
||||
heap_free( ascii_req );
|
||||
if(res != ERROR_SUCCESS) {
|
||||
TRACE("send failed: %u\n", res);
|
||||
if(!reusing_connection)
|
||||
|
@ -4737,7 +4725,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
if (strcmpW(request->verb, szGET) && strcmpW(request->verb, szHEAD) &&
|
||||
dwStatusCode != HTTP_STATUS_REDIRECT_KEEP_VERB)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, request->verb);
|
||||
heap_free(request->verb);
|
||||
request->verb = heap_strdupW(szGET);
|
||||
}
|
||||
drain_content(request);
|
||||
|
@ -4748,10 +4736,10 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
res = HTTP_HandleRedirect(request, new_url);
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, requestString);
|
||||
heap_free(requestString);
|
||||
loop_next = TRUE;
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, new_url );
|
||||
heap_free( new_url );
|
||||
}
|
||||
redirected = TRUE;
|
||||
}
|
||||
|
@ -4772,7 +4760,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
request->session->password,
|
||||
Host->lpszValue))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, requestString);
|
||||
heap_free(requestString);
|
||||
loop_next = TRUE;
|
||||
break;
|
||||
}
|
||||
|
@ -4817,8 +4805,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
|
|||
HTTP_CacheRequest(request);
|
||||
|
||||
lend:
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, requestString);
|
||||
heap_free(requestString);
|
||||
|
||||
/* TODO: send notification for P3P header */
|
||||
|
||||
|
@ -4857,7 +4844,7 @@ static void AsyncHttpSendRequestProc(WORKREQUEST *workRequest)
|
|||
req->dwHeaderLength, req->lpOptional, req->dwOptionalLength,
|
||||
req->dwContentLength, req->bEndRequest);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszHeader);
|
||||
heap_free(req->lpszHeader);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4908,7 +4895,7 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_
|
|||
if (strcmpW(request->verb, szGET) && strcmpW(request->verb, szHEAD) &&
|
||||
dwCode != HTTP_STATUS_REDIRECT_KEEP_VERB)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, request->verb);
|
||||
heap_free(request->verb);
|
||||
request->verb = heap_strdupW(szGET);
|
||||
}
|
||||
drain_content(request);
|
||||
|
@ -4919,7 +4906,7 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_
|
|||
res = HTTP_HandleRedirect(request, new_url);
|
||||
if (res == ERROR_SUCCESS)
|
||||
res = HTTP_HttpSendRequestW(request, NULL, 0, NULL, 0, 0, TRUE);
|
||||
HeapFree( GetProcessHeap(), 0, new_url );
|
||||
heap_free( new_url );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5083,8 +5070,7 @@ BOOL WINAPI HttpSendRequestExA(HINTERNET hRequest,
|
|||
|
||||
rc = HttpSendRequestExW(hRequest, lpBuffersIn ? &BuffersInW : NULL, NULL, dwFlags, dwContext);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,header);
|
||||
|
||||
heap_free(header);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -5299,8 +5285,8 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
|
|||
szHeaders = heap_alloc(nLen*sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP,0,lpszHeaders,dwHeaderLength,szHeaders,nLen);
|
||||
}
|
||||
result=HttpSendRequestW(hHttpRequest, szHeaders, nLen, lpOptional, dwOptionalLength);
|
||||
HeapFree(GetProcessHeap(),0,szHeaders);
|
||||
result = HttpSendRequestW(hHttpRequest, szHeaders, nLen, lpOptional, dwOptionalLength);
|
||||
heap_free(szHeaders);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -5318,10 +5304,10 @@ static void HTTPSESSION_Destroy(object_header_t *hdr)
|
|||
|
||||
WININET_Release(&session->appInfo->hdr);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, session->hostName);
|
||||
HeapFree(GetProcessHeap(), 0, session->serverName);
|
||||
HeapFree(GetProcessHeap(), 0, session->password);
|
||||
HeapFree(GetProcessHeap(), 0, session->userName);
|
||||
heap_free(session->hostName);
|
||||
heap_free(session->serverName);
|
||||
heap_free(session->password);
|
||||
heap_free(session->userName);
|
||||
}
|
||||
|
||||
static DWORD HTTPSESSION_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
|
||||
|
@ -5348,13 +5334,13 @@ static DWORD HTTPSESSION_SetOption(object_header_t *hdr, DWORD option, void *buf
|
|||
switch(option) {
|
||||
case INTERNET_OPTION_USERNAME:
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, ses->userName);
|
||||
heap_free(ses->userName);
|
||||
if (!(ses->userName = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
case INTERNET_OPTION_PASSWORD:
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, ses->password);
|
||||
heap_free(ses->password);
|
||||
if (!(ses->password = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
@ -5543,13 +5529,13 @@ static INT HTTP_GetResponseHeaders(http_request_t *request, BOOL clear)
|
|||
{
|
||||
WARN("No status line at head of response (%s)\n", debugstr_w(buffer));
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->version);
|
||||
HeapFree(GetProcessHeap(), 0, request->statusText);
|
||||
heap_free(request->version);
|
||||
heap_free(request->statusText);
|
||||
|
||||
request->version = heap_strdupW(g_szHttp1_0);
|
||||
request->statusText = heap_strdupW(szOK);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->rawHeaders);
|
||||
heap_free(request->rawHeaders);
|
||||
request->rawHeaders = heap_strdupW(szDefaultHeader);
|
||||
|
||||
bSuccess = TRUE;
|
||||
|
@ -5561,8 +5547,8 @@ static INT HTTP_GetResponseHeaders(http_request_t *request, BOOL clear)
|
|||
HTTP_ProcessHeader(request, szStatus, status_code,
|
||||
HTTP_ADDHDR_FLAG_REPLACE);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,request->version);
|
||||
HeapFree(GetProcessHeap(),0,request->statusText);
|
||||
heap_free(request->version);
|
||||
heap_free(request->statusText);
|
||||
|
||||
request->version = heap_strdupW(buffer);
|
||||
request->statusText = heap_strdupW(status_text);
|
||||
|
@ -5640,7 +5626,7 @@ static INT HTTP_GetResponseHeaders(http_request_t *request, BOOL clear)
|
|||
|
||||
memcpy(&lpszRawHeaders[cchRawHeaders], szCrLf, sizeof(szCrLf));
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->rawHeaders);
|
||||
heap_free(request->rawHeaders);
|
||||
request->rawHeaders = lpszRawHeaders;
|
||||
TRACE("raw headers: %s\n", debugstr_w(lpszRawHeaders));
|
||||
bSuccess = TRUE;
|
||||
|
@ -5652,7 +5638,7 @@ lend:
|
|||
return rc;
|
||||
else
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpszRawHeaders);
|
||||
heap_free(lpszRawHeaders);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -5917,8 +5903,8 @@ static BOOL HTTP_DeleteCustomHeader(http_request_t *request, DWORD index)
|
|||
return FALSE;
|
||||
request->nCustHeaders--;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, request->custHeaders[index].lpszField);
|
||||
HeapFree(GetProcessHeap(), 0, request->custHeaders[index].lpszValue);
|
||||
heap_free(request->custHeaders[index].lpszField);
|
||||
heap_free(request->custHeaders[index].lpszValue);
|
||||
|
||||
memmove( &request->custHeaders[index], &request->custHeaders[index+1],
|
||||
(request->nCustHeaders - index)* sizeof(HTTPHEADERW) );
|
||||
|
|
|
@ -300,27 +300,24 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
LPVOID lpwite = TlsGetValue(g_dwTlsErrIndex);
|
||||
HeapFree(GetProcessHeap(), 0, lpwite);
|
||||
}
|
||||
break;
|
||||
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
heap_free(TlsGetValue(g_dwTlsErrIndex));
|
||||
}
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
collect_connections(TRUE);
|
||||
NETCON_unload();
|
||||
URLCacheContainers_DeleteAll();
|
||||
|
||||
URLCacheContainers_DeleteAll();
|
||||
|
||||
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, TlsGetValue(g_dwTlsErrIndex));
|
||||
TlsFree(g_dwTlsErrIndex);
|
||||
}
|
||||
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
heap_free(TlsGetValue(g_dwTlsErrIndex));
|
||||
TlsFree(g_dwTlsErrIndex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -497,8 +494,8 @@ BOOL WINAPI DetectAutoProxyUrl(LPSTR lpszAutoProxyUrl,
|
|||
|
||||
static void FreeProxyInfo( proxyinfo_t *lpwpi )
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpwpi->lpszProxyServer);
|
||||
HeapFree(GetProcessHeap(), 0, lpwpi->lpszProxyBypass);
|
||||
heap_free(lpwpi->lpszProxyServer);
|
||||
heap_free(lpwpi->lpszProxyBypass);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -681,11 +678,11 @@ static VOID APPINFO_Destroy(object_header_t *hdr)
|
|||
|
||||
TRACE("%p\n",lpwai);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpwai->agent);
|
||||
HeapFree(GetProcessHeap(), 0, lpwai->proxy);
|
||||
HeapFree(GetProcessHeap(), 0, lpwai->proxyBypass);
|
||||
HeapFree(GetProcessHeap(), 0, lpwai->proxyUsername);
|
||||
HeapFree(GetProcessHeap(), 0, lpwai->proxyPassword);
|
||||
heap_free(lpwai->agent);
|
||||
heap_free(lpwai->proxy);
|
||||
heap_free(lpwai->proxyBypass);
|
||||
heap_free(lpwai->proxyUsername);
|
||||
heap_free(lpwai->proxyPassword);
|
||||
}
|
||||
|
||||
static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
|
||||
|
@ -925,10 +922,9 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
|
|||
|
||||
rc = InternetOpenW(szAgent, dwAccessType, szProxy, szBypass, dwFlags);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, szAgent);
|
||||
HeapFree(GetProcessHeap(), 0, szProxy);
|
||||
HeapFree(GetProcessHeap(), 0, szBypass);
|
||||
|
||||
heap_free(szAgent);
|
||||
heap_free(szProxy);
|
||||
heap_free(szBypass);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1093,10 +1089,8 @@ BOOL WINAPI InternetGetConnectedStateExA(LPDWORD lpdwStatus, LPSTR lpszConnectio
|
|||
{
|
||||
WideCharToMultiByte(CP_ACP,0,lpwszConnectionName,-1,lpszConnectionName,
|
||||
dwNameLen, NULL, NULL);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,lpwszConnectionName);
|
||||
heap_free(lpwszConnectionName);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1192,9 +1186,9 @@ HINTERNET WINAPI InternetConnectA(HINTERNET hInternet,
|
|||
rc = InternetConnectW(hInternet, szServerName, nServerPort,
|
||||
szUserName, szPassword, dwService, dwFlags, dwContext);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, szServerName);
|
||||
HeapFree(GetProcessHeap(), 0, szUserName);
|
||||
HeapFree(GetProcessHeap(), 0, szPassword);
|
||||
heap_free(szServerName);
|
||||
heap_free(szUserName);
|
||||
heap_free(szPassword);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1441,13 +1435,13 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
|
|||
debugstr_an(lpUrlComponents->lpszUrlPath, lpUrlComponents->dwUrlPathLength),
|
||||
debugstr_an(lpUrlComponents->lpszExtraInfo, lpUrlComponents->dwExtraInfoLength));
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, lpwszUrl);
|
||||
HeapFree(GetProcessHeap(), 0, hostname);
|
||||
HeapFree(GetProcessHeap(), 0, username);
|
||||
HeapFree(GetProcessHeap(), 0, password);
|
||||
HeapFree(GetProcessHeap(), 0, path);
|
||||
HeapFree(GetProcessHeap(), 0, scheme);
|
||||
HeapFree(GetProcessHeap(), 0, extra);
|
||||
heap_free(lpwszUrl);
|
||||
heap_free(hostname);
|
||||
heap_free(username);
|
||||
heap_free(password);
|
||||
heap_free(path);
|
||||
heap_free(scheme);
|
||||
heap_free(extra);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1581,7 +1575,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
|
|||
url_tmp[dwUrlLength] = 0;
|
||||
if (!(lpszUrl_decode = heap_alloc(len * sizeof(WCHAR))))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, url_tmp);
|
||||
heap_free(url_tmp);
|
||||
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1590,7 +1584,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
|
|||
dwUrlLength = len;
|
||||
lpszUrl = lpszUrl_decode;
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, url_tmp);
|
||||
heap_free(url_tmp);
|
||||
}
|
||||
lpszap = lpszUrl;
|
||||
|
||||
|
@ -1848,7 +1842,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
|
|||
debugstr_wn(lpUC->lpszUrlPath,lpUC->dwUrlPathLength),
|
||||
debugstr_wn(lpUC->lpszExtraInfo,lpUC->dwExtraInfoLength));
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpszUrl_decode );
|
||||
heap_free( lpszUrl_decode );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -2675,7 +2669,7 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
|
|||
|
||||
switch (option->dwOption) {
|
||||
case INTERNET_PER_CONN_PROXY_SERVER:
|
||||
HeapFree(GetProcessHeap(), 0, pi.lpszProxyServer);
|
||||
heap_free(pi.lpszProxyServer);
|
||||
pi.lpszProxyServer = heap_strdupW(option->Value.pszValue);
|
||||
break;
|
||||
|
||||
|
@ -2870,15 +2864,15 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
|
|||
case INTERNET_PER_CONN_PROXY_SERVER:
|
||||
case INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL:
|
||||
case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL:
|
||||
HeapFree( GetProcessHeap(), 0, opt->Value.pszValue );
|
||||
heap_free( opt->Value.pszValue );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, list->pOptions );
|
||||
heap_free( list->pOptions );
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, wbuffer );
|
||||
heap_free( wbuffer );
|
||||
}
|
||||
|
||||
return r;
|
||||
|
@ -2995,7 +2989,7 @@ BOOL WINAPI InternetTimeToSystemTimeA( LPCSTR string, SYSTEMTIME* time, DWORD re
|
|||
if (stringW)
|
||||
{
|
||||
ret = InternetTimeToSystemTimeW( stringW, time, reserved );
|
||||
HeapFree( GetProcessHeap(), 0, stringW );
|
||||
heap_free( stringW );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -3179,8 +3173,7 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
|
|||
}
|
||||
|
||||
End:
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, command );
|
||||
heap_free( command );
|
||||
if (rc == FALSE)
|
||||
INTERNET_SetLastError(ERROR_NOT_CONNECTED);
|
||||
|
||||
|
@ -3211,7 +3204,7 @@ BOOL WINAPI InternetCheckConnectionA(LPCSTR lpszUrl, DWORD dwFlags, DWORD dwRese
|
|||
|
||||
rc = InternetCheckConnectionW(url, dwFlags, dwReserved);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, url);
|
||||
heap_free(url);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -3298,7 +3291,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
|
|||
strcpyW(path_extra, urlComponents.lpszUrlPath);
|
||||
strcatW(path_extra, urlComponents.lpszExtraInfo);
|
||||
client1 = HttpOpenRequestW(client, NULL, path_extra, NULL, NULL, accept, dwFlags, dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, path_extra);
|
||||
heap_free(path_extra);
|
||||
}
|
||||
else
|
||||
client1 = HttpOpenRequestW(client, NULL, path, NULL, NULL, accept, dwFlags, dwContext);
|
||||
|
@ -3345,8 +3338,8 @@ static void AsyncInternetOpenUrlProc(WORKREQUEST *workRequest)
|
|||
|
||||
INTERNET_InternetOpenUrlW(hIC, req->lpszUrl,
|
||||
req->lpszHeaders, req->dwHeadersLength, req->dwFlags, req->dwContext);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszUrl);
|
||||
HeapFree(GetProcessHeap(), 0, req->lpszHeaders);
|
||||
heap_free(req->lpszUrl);
|
||||
heap_free(req->lpszHeaders);
|
||||
}
|
||||
|
||||
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
|
||||
|
@ -3432,7 +3425,7 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
|
|||
lenHeaders = MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, NULL, 0 );
|
||||
szHeaders = heap_alloc(lenHeaders*sizeof(WCHAR));
|
||||
if(!szHeaders) {
|
||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||
heap_free(szUrl);
|
||||
return NULL;
|
||||
}
|
||||
MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, szHeaders, lenHeaders);
|
||||
|
@ -3441,9 +3434,8 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
|
|||
rc = InternetOpenUrlW(hInternet, szUrl, szHeaders,
|
||||
lenHeaders, dwFlags, dwContext);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||
HeapFree(GetProcessHeap(), 0, szHeaders);
|
||||
|
||||
heap_free(szUrl);
|
||||
heap_free(szHeaders);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -3460,10 +3452,9 @@ static LPWITHREADERROR INTERNET_AllocThreadError(void)
|
|||
|
||||
if (!TlsSetValue(g_dwTlsErrIndex, lpwite))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpwite);
|
||||
heap_free(lpwite);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return lpwite;
|
||||
}
|
||||
|
||||
|
@ -3523,14 +3514,14 @@ static DWORD CALLBACK INTERNET_WorkerThreadFunc(LPVOID lpvParam)
|
|||
TRACE("\n");
|
||||
|
||||
workRequest = *lpRequest;
|
||||
HeapFree(GetProcessHeap(), 0, lpRequest);
|
||||
heap_free(lpRequest);
|
||||
|
||||
workRequest.asyncproc(&workRequest);
|
||||
WININET_Release( workRequest.hdr );
|
||||
|
||||
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, TlsGetValue(g_dwTlsErrIndex));
|
||||
heap_free(TlsGetValue(g_dwTlsErrIndex));
|
||||
TlsSetValue(g_dwTlsErrIndex, NULL);
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -3561,10 +3552,9 @@ DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest)
|
|||
bSuccess = QueueUserWorkItem(INTERNET_WorkerThreadFunc, lpNewRequest, WT_EXECUTELONGFUNCTION);
|
||||
if (!bSuccess)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, lpNewRequest);
|
||||
heap_free(lpNewRequest);
|
||||
return ERROR_INTERNET_ASYNC_THREAD_FAILED;
|
||||
}
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -4028,14 +4018,13 @@ BOOL WINAPI InternetCreateUrlA(LPURL_COMPONENTSA lpUrlComponents, DWORD dwFlags,
|
|||
if (ret)
|
||||
WideCharToMultiByte(CP_ACP, 0, urlW, -1, lpszUrl, *lpdwUrlLength + 1, NULL, NULL);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, urlCompW.lpszScheme);
|
||||
HeapFree(GetProcessHeap(), 0, urlCompW.lpszHostName);
|
||||
HeapFree(GetProcessHeap(), 0, urlCompW.lpszUserName);
|
||||
HeapFree(GetProcessHeap(), 0, urlCompW.lpszPassword);
|
||||
HeapFree(GetProcessHeap(), 0, urlCompW.lpszUrlPath);
|
||||
HeapFree(GetProcessHeap(), 0, urlCompW.lpszExtraInfo);
|
||||
HeapFree(GetProcessHeap(), 0, urlW);
|
||||
|
||||
heap_free(urlCompW.lpszScheme);
|
||||
heap_free(urlCompW.lpszHostName);
|
||||
heap_free(urlCompW.lpszUserName);
|
||||
heap_free(urlCompW.lpszPassword);
|
||||
heap_free(urlCompW.lpszUrlPath);
|
||||
heap_free(urlCompW.lpszExtraInfo);
|
||||
heap_free(urlW);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ static PCCERT_CONTEXT X509_to_cert_context(X509 *cert)
|
|||
if (malloced)
|
||||
free(buffer);
|
||||
else
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
heap_free(buffer);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ static DWORD init_openssl(void)
|
|||
|
||||
pCRYPTO_set_id_callback(ssl_thread_id);
|
||||
num_ssl_locks = pCRYPTO_num_locks();
|
||||
ssl_locks = HeapAlloc(GetProcessHeap(), 0, num_ssl_locks * sizeof(CRITICAL_SECTION));
|
||||
ssl_locks = heap_alloc(num_ssl_locks * sizeof(CRITICAL_SECTION));
|
||||
if(!ssl_locks)
|
||||
return ERROR_OUTOFMEMORY;
|
||||
|
||||
|
@ -582,7 +582,7 @@ void NETCON_unload(void)
|
|||
{
|
||||
int i;
|
||||
for (i = 0; i < num_ssl_locks; i++) DeleteCriticalSection(&ssl_locks[i]);
|
||||
HeapFree(GetProcessHeap(), 0, ssl_locks);
|
||||
heap_free(ssl_locks);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -469,15 +469,15 @@ static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path,
|
|||
pContainer->path = heap_strdupW(path);
|
||||
if (!pContainer->path)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pContainer);
|
||||
heap_free(pContainer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pContainer->cache_prefix = heap_alloc((cache_prefix_len + 1) * sizeof(WCHAR));
|
||||
if (!pContainer->cache_prefix)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pContainer->path);
|
||||
HeapFree(GetProcessHeap(), 0, pContainer);
|
||||
heap_free(pContainer->path);
|
||||
heap_free(pContainer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -489,8 +489,8 @@ static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path,
|
|||
if ((pContainer->hMutex = CreateMutexW(NULL, FALSE, mutex_name)) == NULL)
|
||||
{
|
||||
ERR("couldn't create mutex (error is %d)\n", GetLastError());
|
||||
HeapFree(GetProcessHeap(), 0, pContainer->path);
|
||||
HeapFree(GetProcessHeap(), 0, pContainer);
|
||||
heap_free(pContainer->path);
|
||||
heap_free(pContainer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -505,9 +505,9 @@ static void URLCacheContainer_DeleteContainer(URLCACHECONTAINER * pContainer)
|
|||
|
||||
URLCacheContainer_CloseIndex(pContainer);
|
||||
CloseHandle(pContainer->hMutex);
|
||||
HeapFree(GetProcessHeap(), 0, pContainer->path);
|
||||
HeapFree(GetProcessHeap(), 0, pContainer->cache_prefix);
|
||||
HeapFree(GetProcessHeap(), 0, pContainer);
|
||||
heap_free(pContainer->path);
|
||||
heap_free(pContainer->cache_prefix);
|
||||
heap_free(pContainer);
|
||||
}
|
||||
|
||||
void URLCacheContainers_CreateDefaults(void)
|
||||
|
@ -607,7 +607,7 @@ static DWORD URLCacheContainers_FindContainerA(LPCSTR lpszUrl, URLCACHECONTAINER
|
|||
return ERROR_OUTOFMEMORY;
|
||||
|
||||
ret = URLCacheContainers_FindContainerW(url, ppContainer);
|
||||
HeapFree(GetProcessHeap(), 0, url);
|
||||
heap_free(url);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1263,7 +1263,7 @@ static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, stru
|
|||
}
|
||||
|
||||
ret = URLCache_FindHash(pHeader, urlA, ppHashEntry);
|
||||
HeapFree(GetProcessHeap(), 0, urlA);
|
||||
heap_free(urlA);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2328,32 +2328,31 @@ BOOL WINAPI CreateUrlCacheEntryA(
|
|||
|
||||
if (lpszUrlName && (url_name = heap_strdupAtoW(lpszUrlName)))
|
||||
{
|
||||
if (!lpszFileExtension || (file_extension = heap_strdupAtoW(lpszFileExtension)))
|
||||
{
|
||||
if (CreateUrlCacheEntryW(url_name, dwExpectedFileSize, file_extension, file_name, dwReserved))
|
||||
{
|
||||
if (WideCharToMultiByte(CP_ACP, 0, file_name, -1, lpszFileName, MAX_PATH, NULL, NULL) < MAX_PATH)
|
||||
{
|
||||
bSuccess = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, file_extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, url_name);
|
||||
if (!bSuccess)
|
||||
SetLastError(dwError);
|
||||
if (!lpszFileExtension || (file_extension = heap_strdupAtoW(lpszFileExtension)))
|
||||
{
|
||||
if (CreateUrlCacheEntryW(url_name, dwExpectedFileSize, file_extension, file_name, dwReserved))
|
||||
{
|
||||
if (WideCharToMultiByte(CP_ACP, 0, file_name, -1, lpszFileName, MAX_PATH, NULL, NULL) < MAX_PATH)
|
||||
{
|
||||
bSuccess = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
}
|
||||
heap_free(file_extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
}
|
||||
heap_free(url_name);
|
||||
if (!bSuccess) SetLastError(dwError);
|
||||
}
|
||||
return bSuccess;
|
||||
}
|
||||
|
@ -2796,8 +2795,8 @@ static BOOL CommitUrlCacheEntryInternal(
|
|||
|
||||
cleanup:
|
||||
URLCacheContainer_UnlockIndex(pContainer, pHeader);
|
||||
HeapFree(GetProcessHeap(), 0, lpszUrlNameA);
|
||||
HeapFree(GetProcessHeap(), 0, lpszFileExtensionA);
|
||||
heap_free(lpszUrlNameA);
|
||||
heap_free(lpszFileExtensionA);
|
||||
|
||||
if (error == ERROR_SUCCESS)
|
||||
return TRUE;
|
||||
|
@ -2867,11 +2866,10 @@ BOOL WINAPI CommitUrlCacheEntryA(
|
|||
file_extension, original_url);
|
||||
|
||||
cleanup:
|
||||
HeapFree(GetProcessHeap(), 0, original_url);
|
||||
HeapFree(GetProcessHeap(), 0, file_extension);
|
||||
HeapFree(GetProcessHeap(), 0, local_file_name);
|
||||
HeapFree(GetProcessHeap(), 0, url_name);
|
||||
|
||||
heap_free(original_url);
|
||||
heap_free(file_extension);
|
||||
heap_free(local_file_name);
|
||||
heap_free(url_name);
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
|
@ -2918,7 +2916,7 @@ BOOL WINAPI CommitUrlCacheEntryW(
|
|||
}
|
||||
if (header_info)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, header_info);
|
||||
heap_free(header_info);
|
||||
if (!bSuccess)
|
||||
SetLastError(dwError);
|
||||
}
|
||||
|
@ -3103,12 +3101,8 @@ BOOL WINAPI UnlockUrlCacheEntryStream(
|
|||
if (!UnlockUrlCacheEntryFileA(pStream->lpszUrl, 0))
|
||||
return FALSE;
|
||||
|
||||
/* close file handle */
|
||||
CloseHandle(pStream->hFile);
|
||||
|
||||
/* free allocated space */
|
||||
HeapFree(GetProcessHeap(), 0, pStream);
|
||||
|
||||
heap_free(pStream);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -3184,7 +3178,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
|
|||
error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer);
|
||||
if (error != ERROR_SUCCESS)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, urlA);
|
||||
heap_free(urlA);
|
||||
SetLastError(error);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -3192,14 +3186,14 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
|
|||
error = URLCacheContainer_OpenIndex(pContainer);
|
||||
if (error != ERROR_SUCCESS)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, urlA);
|
||||
heap_free(urlA);
|
||||
SetLastError(error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!(pHeader = URLCacheContainer_LockIndex(pContainer)))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, urlA);
|
||||
heap_free(urlA);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3207,7 +3201,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
|
|||
{
|
||||
URLCacheContainer_UnlockIndex(pContainer, pHeader);
|
||||
TRACE("entry %s not found!\n", debugstr_a(urlA));
|
||||
HeapFree(GetProcessHeap(), 0, urlA);
|
||||
heap_free(urlA);
|
||||
SetLastError(ERROR_FILE_NOT_FOUND);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -3215,8 +3209,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
|
|||
ret = DeleteUrlCacheEntryInternal(pHeader, pHashEntry);
|
||||
|
||||
URLCacheContainer_UnlockIndex(pContainer, pHeader);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, urlA);
|
||||
heap_free(urlA);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3360,7 +3353,7 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,
|
|||
pEntryHandle->lpszUrlSearchPattern = heap_strdupAtoW(lpszUrlSearchPattern);
|
||||
if (!pEntryHandle->lpszUrlSearchPattern)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pEntryHandle);
|
||||
heap_free(pEntryHandle);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -3372,7 +3365,7 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,
|
|||
|
||||
if (!FindNextUrlCacheEntryA(pEntryHandle, lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pEntryHandle);
|
||||
heap_free(pEntryHandle);
|
||||
return NULL;
|
||||
}
|
||||
return pEntryHandle;
|
||||
|
@ -3399,7 +3392,7 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,
|
|||
pEntryHandle->lpszUrlSearchPattern = heap_strdupW(lpszUrlSearchPattern);
|
||||
if (!pEntryHandle->lpszUrlSearchPattern)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pEntryHandle);
|
||||
heap_free(pEntryHandle);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -3411,7 +3404,7 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,
|
|||
|
||||
if (!FindNextUrlCacheEntryW(pEntryHandle, lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, pEntryHandle);
|
||||
heap_free(pEntryHandle);
|
||||
return NULL;
|
||||
}
|
||||
return pEntryHandle;
|
||||
|
@ -3545,9 +3538,8 @@ BOOL WINAPI FindCloseUrlCache(HANDLE hEnumHandle)
|
|||
}
|
||||
|
||||
pEntryHandle->dwMagic = 0;
|
||||
HeapFree(GetProcessHeap(), 0, pEntryHandle->lpszUrlSearchPattern);
|
||||
HeapFree(GetProcessHeap(), 0, pEntryHandle);
|
||||
|
||||
heap_free(pEntryHandle->lpszUrlSearchPattern);
|
||||
heap_free(pEntryHandle);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
|||
hints.ai_family = AF_INET;
|
||||
|
||||
ret = getaddrinfo( name, NULL, &hints, &res );
|
||||
HeapFree( GetProcessHeap(), 0, name );
|
||||
heap_free( name );
|
||||
if (ret != 0)
|
||||
{
|
||||
TRACE("failed to get IPv4 address of %s (%s), retrying with IPv6\n", debugstr_w(lpszServerName), gai_strerror(ret));
|
||||
|
@ -219,7 +219,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
|||
#else
|
||||
EnterCriticalSection( &cs_gethostbyname );
|
||||
phe = gethostbyname(name);
|
||||
HeapFree( GetProcessHeap(), 0, name );
|
||||
heap_free( name );
|
||||
|
||||
if (NULL == phe)
|
||||
{
|
||||
|
@ -341,7 +341,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
|
|||
TRACE(" end callback().\n");
|
||||
|
||||
if(lpvNewInfo != lpvStatusInfo)
|
||||
HeapFree(GetProcessHeap(), 0, lpvNewInfo);
|
||||
heap_free(lpvNewInfo);
|
||||
}
|
||||
|
||||
static void SendAsyncCallbackProc(WORKREQUEST *workRequest)
|
||||
|
@ -355,7 +355,7 @@ static void SendAsyncCallbackProc(WORKREQUEST *workRequest)
|
|||
req->dwStatusInfoLength);
|
||||
|
||||
/* And frees the copy of the status info */
|
||||
HeapFree(GetProcessHeap(), 0, req->lpvStatusInfo);
|
||||
heap_free(req->lpvStatusInfo);
|
||||
}
|
||||
|
||||
void SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext,
|
||||
|
|
Loading…
Reference in New Issue