Commit 127b502c authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Fix memory leak in error case.

parent 61c0dcdb
......@@ -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);
......
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