Sven Baars : gdiplus: Fix a memory leak on error path (Valgrind).

Alexandre Julliard julliard at winehq.org
Wed May 15 14:32:22 CDT 2019


Module: wine
Branch: stable
Commit: 66529e3f22df5af58f92cb862e52ae726e9d427e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=66529e3f22df5af58f92cb862e52ae726e9d427e

Author: Sven Baars <sven.wine at gmail.com>
Date:   Thu Jan 24 11:59:47 2019 +0100

gdiplus: Fix a memory leak on error path (Valgrind).

Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 85630593b87a031f9858a5bcadaed9621ef326bb)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/gdiplus/image.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 2e844cf..8a136ef 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -3570,7 +3570,11 @@ static GpStatus initialize_decoder_wic(IStream *stream, REFGUID container, IWICB
     if (FAILED(hr)) return hresult_to_status(hr);
 
     hr = IWICBitmapDecoder_Initialize(*decoder, stream, WICDecodeMetadataCacheOnLoad);
-    if (FAILED(hr)) return hresult_to_status(hr);
+    if (FAILED(hr))
+    {
+        IWICBitmapDecoder_Release(*decoder);
+        return hresult_to_status(hr);
+    }
     return Ok;
 }
 




More information about the wine-cvs mailing list