From adc3492107467d0877342ca084b8b6f64c623c9e Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Tue, 28 Dec 2021 21:04:02 -0700 Subject: [PATCH] wmphoto: Fix memory leak on error path in wmp_decoder_create (Coverity). Signed-off-by: Alex Henrie Signed-off-by: Esme Povirk Signed-off-by: Alexandre Julliard --- dlls/wmphoto/jxrlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/wmphoto/jxrlib.c b/dlls/wmphoto/jxrlib.c index 757312b5f0f..3d7dedb869d 100644 --- a/dlls/wmphoto/jxrlib.c +++ b/dlls/wmphoto/jxrlib.c @@ -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;