Commit 8ed1ca3e authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

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

parent 04dad621
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment