From ec09119f2e76a6d4e86290ee7981a1d69d620c00 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 16 Sep 2018 16:23:03 +0300 Subject: [PATCH] comctl32/button: Fix text buffer leak (Coverity). Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/comctl32/button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 5621fda4f36..56a47302c90 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -1293,7 +1293,6 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la /* Get text rect */ maxTextWidth = labelRc->right - labelRc->left; textRect = BUTTON_GetTextRect(infoPtr, hdc, text, maxTextWidth); - heap_free(text); /* Show image and text */ if (show_image_and_text(infoPtr)) @@ -1361,6 +1360,7 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la SetRectEmpty(&imageRect); } } + heap_free(text); CopyRect(labelRc, &labelRect); CopyRect(imageRc, &imageRect);