From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/datetime.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index ce154aacbea..fb54d329807 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -35,6 +35,7 @@ #include <stdarg.h> #include <stdio.h> #include <limits.h> +#include <stdlib.h>
#include "windef.h" #include "winbase.h" @@ -350,10 +351,10 @@ DATETIME_SetFormatA (DATETIME_INFO *infoPtr, LPCSTR lpszFormat) if (lpszFormat) { BOOL retval; INT len = MultiByteToWideChar(CP_ACP, 0, lpszFormat, -1, NULL, 0); - LPWSTR wstr = Alloc(len * sizeof(WCHAR)); + LPWSTR wstr = calloc(len, sizeof(WCHAR)); if (wstr) MultiByteToWideChar(CP_ACP, 0, lpszFormat, -1, wstr, len); retval = DATETIME_SetFormatW (infoPtr, wstr); - Free (wstr); + free (wstr); return retval; } else @@ -1605,7 +1606,7 @@ DATETIME_SetFont (DATETIME_INFO *infoPtr, HFONT font, BOOL repaint) static LRESULT DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) { - DATETIME_INFO *infoPtr = Alloc (sizeof(DATETIME_INFO)); + DATETIME_INFO *infoPtr = calloc (1, sizeof(*infoPtr)); STYLESTRUCT ss = { 0, lpcs->style };
if (!infoPtr) return -1; @@ -1657,10 +1658,10 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr) if (infoPtr->hMonthCal) DestroyWindow(infoPtr->hMonthCal); SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 ); /* clear infoPtr */ - Free (infoPtr->buflen); - Free (infoPtr->fieldRect); - Free (infoPtr->fieldspec); - Free (infoPtr); + free (infoPtr->buflen); + free (infoPtr->fieldRect); + free (infoPtr->fieldspec); + free (infoPtr); return 0; }