mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[COMCTL32] Don't leak memory in PB_ThemedPaint()
CID 1441373
This commit is contained in:
parent
a0c33934fc
commit
3fddd3157c
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue