[PATCH] comctl32/button: Fix text buffer leak (Coverity).

Nikolay Sivov nsivov at codeweavers.com
Sun Sep 16 08:23:03 CDT 2018


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 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 5621fda4f3..56a47302c9 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);
-- 
2.18.0




More information about the wine-devel mailing list