Piotr Caban : gdiplus: Fix leak in SOFTWARE_GdipDrawDriverString.

Alexandre Julliard julliard at winehq.org
Tue Jun 2 08:11:19 CDT 2020


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Mar  5 16:04:31 2020 +0100

gdiplus: Fix leak in SOFTWARE_GdipDrawDriverString.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit f65cca4de3f6a97f0c3f6837036864719e714520)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

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

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index a93ccb1baf..2d7f4bdb80 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -7215,8 +7215,13 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI
     }
 
     if (max_glyphsize == 0)
+    {
         /* Nothing to draw. */
+        heap_free(pti);
+        DeleteDC(hdc);
+        DeleteObject(hfont);
         return Ok;
+    }
 
     glyph_mask = heap_alloc_zero(max_glyphsize);
     text_mask = heap_alloc_zero((max_x - min_x) * (max_y - min_y));




More information about the wine-cvs mailing list