- Fix mismatched allocation/free. Spotted by Samuel & cppcheck
CORE-8207 #resolve
svn path=/trunk/; revision=63249
}
/* A page-aligned buffer usually give more speed */
- buffer = (LPBYTE)VirtualAlloc(NULL, BUFF_SIZE, MEM_COMMIT, PAGE_READWRITE);
+ buffer = VirtualAlloc(NULL, BUFF_SIZE, MEM_COMMIT, PAGE_READWRITE);
if (buffer == NULL)
{
CloseHandle (hFileDest);
}
/* Get buffer for the copy process */
- buffer = (LPBYTE)VirtualAlloc(NULL, BUFF_SIZE, MEM_COMMIT, PAGE_READWRITE);
+ buffer = VirtualAlloc(NULL, BUFF_SIZE, MEM_COMMIT, PAGE_READWRITE);
if (buffer == NULL)
{
CloseHandle (hFileDest);
if (dwWritten != dwRead || CheckCtrlBreak(BREAK_INPUT))
{
ConOutResPuts(STRING_COPY_ERROR3);
- cmd_free (buffer);
+ VirtualFree (buffer, 0, MEM_RELEASE);
CloseHandle (hFileDest);
CloseHandle (hFileSrc);
nErrorLevel = 1;