From 8ed1ca3e4b6e1eeaa4419992843ad7f481b1c0cc Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Sat, 11 Mar 2006 14:41:37 +0900 Subject: [PATCH] avifil32: Use HeapAlloc instead of LocalAlloc. Make sure to free the memory. --- dlls/avifil32/factory.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/avifil32/factory.c b/dlls/avifil32/factory.c index b1f95ab4a8b..c1fb3b302b2 100644 --- a/dlls/avifil32/factory.c +++ b/dlls/avifil32/factory.c @@ -75,7 +75,7 @@ static HRESULT AVIFILE_CreateClassFactory(const CLSID *pclsid, const IID *riid, *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_CreateClassFactory(const CLSID *pclsid, const IID *riid, 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_fnRelease(LPCLASSFACTORY iface) if ((--(This->dwRef)) > 0) return This->dwRef; + HeapFree(GetProcessHeap(), 0, This); + return 0; }