Thomas Mullaly : urlmon: Use CoTaskMemFree instead of HeapFree for memory allocated with CoTaskMemAlloc .

Alexandre Julliard julliard at winehq.org
Mon Sep 5 13:26:21 CDT 2011


Module: wine
Branch: master
Commit: 9848872207cd577fa8cb2128dd273d724fe9e2bc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9848872207cd577fa8cb2128dd273d724fe9e2bc

Author: Thomas Mullaly <thomas.mullaly at gmail.com>
Date:   Wed Aug 31 18:44:28 2011 -0400

urlmon: Use CoTaskMemFree instead of HeapFree for memory allocated with CoTaskMemAlloc.

---

 dlls/urlmon/sec_mgr.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index ffbeaa3..7cdc4dd 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -514,7 +514,7 @@ static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone, LPWSTR *ret_url)
     if(hres != S_OK) {
         size = strlenW(url)*sizeof(WCHAR);
 
-        secur_url = heap_alloc(size);
+        secur_url = CoTaskMemAlloc(size);
         if(!secur_url)
             return E_OUTOFMEMORY;
 
@@ -523,7 +523,7 @@ static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone, LPWSTR *ret_url)
 
     hres = CoInternetParseUrl(secur_url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(WCHAR), &size, 0);
     if(FAILED(hres) || !*schema) {
-        heap_free(secur_url);
+        CoTaskMemFree(secur_url);
         return E_INVALIDARG;
     }
 
@@ -571,7 +571,7 @@ static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone, LPWSTR *ret_url)
     }
 
     if(FAILED(hres) || !ret_url)
-        heap_free(secur_url);
+        CoTaskMemFree(secur_url);
     else
         *ret_url = secur_url;
 
@@ -849,7 +849,7 @@ static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManagerEx2 *
 
         static const BYTE secidFile[] = {'f','i','l','e',':'};
 
-        heap_free(url);
+        CoTaskMemFree(url);
 
         if(*pcbSecurityId < sizeof(secidFile)+sizeof(zone))
             return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
@@ -875,12 +875,12 @@ static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManagerEx2 *
     len = WideCharToMultiByte(CP_ACP, 0, url, -1, NULL, 0, NULL, NULL)-1;
 
     if(len+sizeof(DWORD) > *pcbSecurityId) {
-        heap_free(url);
+        CoTaskMemFree(url);
         return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
     }
 
     WideCharToMultiByte(CP_ACP, 0, url, -1, (LPSTR)pbSecurityId, len, NULL, NULL);
-    heap_free(url);
+    CoTaskMemFree(url);
 
     *(DWORD*)(pbSecurityId+len) = zone;
 




More information about the wine-cvs mailing list