[COMCTL32] Don't leak memory in PB_ThemedPaint()

CID 1441373
This commit is contained in:
Pierre Schweitzer 2018-11-16 21:22:50 +01:00
parent a0c33934fc
commit 3fddd3157c
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -1841,6 +1841,9 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu
{
DrawThemeText(theme, hDC, BP_PUSHBUTTON, state, text, lstrlenW(text), dtFlags, 0, &textRect);
heap_free(text);
#ifdef __REACTOS__
text = NULL;
#endif
}
if (focused)
@ -1862,6 +1865,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu
if (cdrf == CDRF_NOTIFYPOSTPAINT)
BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect);
cleanup:
if (text) heap_free(text);
#endif
if (hPrevFont) SelectObject(hDC, hPrevFont);
}