From 130e21795c1fc0527bf1f654001ea438cccc7f04 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Mon, 12 May 2003 03:19:35 +0000 Subject: [PATCH] Fixed a possible memory corruption. Fixed a memory leak. --- dlls/comctl32/monthcal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 46a67d93d4e..755c9496681 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -974,8 +974,8 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->monthRange = infoPtr->maxDate.wMonth - infoPtr->minDate.wMonth; if(infoPtr->monthRange!=prev) { - COMCTL32_ReAlloc(infoPtr->monthdayState, - infoPtr->monthRange * sizeof(MONTHDAYSTATE)); + infoPtr->monthdayState = COMCTL32_ReAlloc(infoPtr->monthdayState, + infoPtr->monthRange * sizeof(MONTHDAYSTATE)); } return 1; @@ -1919,6 +1919,8 @@ MONTHCAL_Destroy(HWND hwnd, WPARAM wParam, LPARAM lParam) MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); /* free month calendar info data */ + if(infoPtr->monthdayState) + COMCTL32_Free(infoPtr->monthdayState); COMCTL32_Free(infoPtr); SetWindowLongA(hwnd, 0, 0); return 0;