wmphoto: Fix memory leak on error path in wmp_decoder_create (Coverity).

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2021-12-28 21:04:02 -07:00 committed by Alexandre Julliard
parent e16ccaf05d
commit adc3492107

View file

@ -358,7 +358,10 @@ HRESULT CDECL wmp_decoder_create(struct decoder_info *info, struct decoder **res
if (PKImageDecode_Create_WMP(&decoder)) return E_FAIL;
This = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(*This));
if (!This)
{
decoder->Release(&decoder);
return E_OUTOFMEMORY;
}
This->decoder_iface.vtable = &wmp_decoder_vtable;
This->WMPStream_iface.Close = &wmp_stream_Close;