Alex Henrie : wmphoto: Fix memory leak on error path in wmp_decoder_create (Coverity).
Module: wine Branch: master Commit: adc3492107467d0877342ca084b8b6f64c623c9e URL: https://source.winehq.org/git/wine.git/?a=commit;h=adc3492107467d0877342ca08... Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Dec 28 21:04:02 2021 -0700 wmphoto: Fix memory leak on error path in wmp_decoder_create (Coverity). Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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;
participants (1)
-
Alexandre Julliard