Nikolay Sivov : comctl32/button: Fix text buffer leak (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Sep 17 15:02:25 CDT 2018


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Sep 16 16:23:03 2018 +0300

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

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 5621fda..56a4730 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);




More information about the wine-cvs mailing list