windowscodecs: Fix memory leak in error case.

This commit is contained in:
Dmitry Timoshkov 2012-07-31 16:17:42 +09:00 committed by Alexandre Julliard
parent 61c0dcdb8b
commit 127b502ce7
1 changed files with 5 additions and 1 deletions

View File

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