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

CID 1441313
This commit is contained in:
Pierre Schweitzer 2018-11-16 21:52:38 +01:00
parent 6416ee982f
commit 52da844825
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -1995,12 +1995,16 @@ static void CB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, Bu
} }
heap_free(text); heap_free(text);
#ifdef __REACTOS__
text = NULL;
#endif
} }
#ifdef __REACTOS__ #ifdef __REACTOS__
if (cdrf == CDRF_NOTIFYPOSTPAINT) if (cdrf == CDRF_NOTIFYPOSTPAINT)
BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect); BUTTON_SendCustomDraw(infoPtr, hDC, CDDS_POSTPAINT, &bgRect);
cleanup: cleanup:
if (text) heap_free(text);
#endif #endif
if (created_font) DeleteObject(font); if (created_font) DeleteObject(font);
if (hPrevFont) SelectObject(hDC, hPrevFont); if (hPrevFont) SelectObject(hDC, hPrevFont);