Commit 130e2179 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Fixed a possible memory corruption.

Fixed a memory leak.
parent cfd60b21
...@@ -974,8 +974,8 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -974,8 +974,8 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->monthRange = infoPtr->maxDate.wMonth - infoPtr->minDate.wMonth; infoPtr->monthRange = infoPtr->maxDate.wMonth - infoPtr->minDate.wMonth;
if(infoPtr->monthRange!=prev) { if(infoPtr->monthRange!=prev) {
COMCTL32_ReAlloc(infoPtr->monthdayState, infoPtr->monthdayState = COMCTL32_ReAlloc(infoPtr->monthdayState,
infoPtr->monthRange * sizeof(MONTHDAYSTATE)); infoPtr->monthRange * sizeof(MONTHDAYSTATE));
} }
return 1; return 1;
...@@ -1919,6 +1919,8 @@ MONTHCAL_Destroy(HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1919,6 +1919,8 @@ MONTHCAL_Destroy(HWND hwnd, WPARAM wParam, LPARAM lParam)
MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd);
/* free month calendar info data */ /* free month calendar info data */
if(infoPtr->monthdayState)
COMCTL32_Free(infoPtr->monthdayState);
COMCTL32_Free(infoPtr); COMCTL32_Free(infoPtr);
SetWindowLongA(hwnd, 0, 0); SetWindowLongA(hwnd, 0, 0);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment