Sven Baars : windowscodecs: Fix a memory leak (Valgrind).

Alexandre Julliard julliard at winehq.org
Fri Jan 25 16:29:06 CST 2019


Module: wine
Branch: master
Commit: 1f132865ec21a644071a04558c116e73c3a62a19
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1f132865ec21a644071a04558c116e73c3a62a19

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

windowscodecs: Fix a memory leak (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>

---

 dlls/windowscodecs/pngformat.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index 7050c95..faffeae 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -620,7 +620,6 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
     if (setjmp(jmpbuf))
     {
         ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info);
-        HeapFree(GetProcessHeap(), 0, row_pointers);
         This->png_ptr = NULL;
         hr = WINCODEC_ERR_UNKNOWNIMAGEFORMAT;
         goto end;
@@ -816,6 +815,9 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p
 end:
     LeaveCriticalSection(&This->lock);
 
+    if (row_pointers)
+        HeapFree(GetProcessHeap(), 0, row_pointers);
+
     return hr;
 }
 




More information about the wine-cvs mailing list