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

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-09-16 16:23:03 +03:00 committed by Alexandre Julliard
parent 06c5e950b1
commit ec09119f2e
1 changed files with 1 additions and 1 deletions

View File

@ -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);