Zhiyi Zhang : gdiplus: Fix a memory leak.

Alexandre Julliard julliard at winehq.org
Tue Jun 19 14:52:01 CDT 2018


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Mon Jun 18 22:00:09 2018 +0800

gdiplus: Fix a memory leak.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 76aabe7..894e879 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1069,7 +1069,11 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
             {
                 HDC hdc = CreateCompatibleDC(NULL);
 
-                if (!hdc) break;
+                if (!hdc)
+                {
+                    DeleteObject(bmp);
+                    break;
+                }
 
                 SelectObject(hdc, bmp);
                 gdi_alpha_blend(graphics, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,




More information about the wine-cvs mailing list