windowscodecs: Fix memory leak in error case.
This commit is contained in:
parent
61c0dcdb8b
commit
127b502ce7
|
@ -476,7 +476,11 @@ static HRESULT WINAPI PaletteImpl_InitializeFromPalette(IWICPalette *iface,
|
|||
colors = HeapAlloc(GetProcessHeap(), 0, sizeof(WICColor) * count);
|
||||
if (!colors) return E_OUTOFMEMORY;
|
||||
hr = IWICPalette_GetColors(source, count, colors, &count);
|
||||
if (hr != S_OK) return hr;
|
||||
if (hr != S_OK)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, colors);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
|
Loading…
Reference in New Issue