From f65cca4de3f6a97f0c3f6837036864719e714520 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 5 Mar 2020 16:04:31 +0100 Subject: [PATCH] gdiplus: Fix leak in SOFTWARE_GdipDrawDriverString. Signed-off-by: Piotr Caban Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/graphics.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index cfcbd56d349..0b6e4ec3774 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -7224,8 +7224,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));