avifil32: Use HeapAlloc instead of LocalAlloc. Make sure to free the memory.

This commit is contained in:
Mike McCormack 2006-03-11 14:41:37 +09:00 committed by Alexandre Julliard
parent 04dad6218f
commit 8ed1ca3e4b
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}