Module: wine Branch: master Commit: 85fdc7d60eb1f08f1fa169d8bfa5e1abd970c4d6 URL: https://gitlab.winehq.org/wine/wine/-/commit/85fdc7d60eb1f08f1fa169d8bfa5e1a...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Dec 2 08:45:33 2022 +0100
ole32: Allocate IEnumSTATDATA data with the process heap.
It will later be freed in EnumSTATDATA_Release with HeapFree, and the copy code path may allocate the member with HeapAlloc.
---
dlls/ole32/datacache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index e6cea25aca6..b3216992af5 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -2527,7 +2527,7 @@ static HRESULT WINAPI DataCache_EnumCache(IOleCache2 *iface, count++; }
- data = CoTaskMemAlloc( count * sizeof(*data) ); + data = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*data) ); if (!data) return E_OUTOFMEMORY;
LIST_FOR_EACH_ENTRY( cache_entry, &This->cache_list, DataCacheEntry, entry ) @@ -2559,7 +2559,7 @@ static HRESULT WINAPI DataCache_EnumCache(IOleCache2 *iface,
fail: while (i--) CoTaskMemFree( data[i].formatetc.ptd ); - CoTaskMemFree( data ); + HeapFree( GetProcessHeap(), 0, data ); return hr; }