Mike McCormack : avifil32: Use HeapAlloc instead of LocalAlloc. Make sure to free the memory.
Module: wine Branch: refs/heads/master Commit: 8ed1ca3e4b6e1eeaa4419992843ad7f481b1c0cc URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=8ed1ca3e4b6e1eeaa4419992... Author: Mike McCormack <mike(a)codeweavers.com> Date: Sat Mar 11 14:41:37 2006 +0900 avifil32: Use HeapAlloc instead of LocalAlloc. Make sure to free the memory. --- dlls/avifil32/factory.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/avifil32/factory.c b/dlls/avifil32/factory.c index b1f95ab..c1fb3b3 100644 --- a/dlls/avifil32/factory.c +++ b/dlls/avifil32/factory.c @@ -75,7 +75,7 @@ static HRESULT AVIFILE_CreateClassFactor *ppv = NULL; - pClassFactory = (IClassFactoryImpl*)LocalAlloc(LPTR, sizeof(*pClassFactory)); + pClassFactory = HeapAlloc(GetProcessHeap(), 0, sizeof(*pClassFactory)); if (pClassFactory == NULL) return E_OUTOFMEMORY; @@ -85,7 +85,7 @@ static HRESULT AVIFILE_CreateClassFactor hr = IClassFactory_QueryInterface((IClassFactory*)pClassFactory, riid, ppv); if (FAILED(hr)) { - LocalFree((HLOCAL)pClassFactory); + HeapFree(GetProcessHeap(), 0, pClassFactory); *ppv = NULL; } @@ -124,6 +124,8 @@ static ULONG WINAPI IClassFactory_fnRele if ((--(This->dwRef)) > 0) return This->dwRef; + HeapFree(GetProcessHeap(), 0, This); + return 0; }
participants (1)
-
Alexandre Julliard