[core] fix a memory leak when search for process is interrupted

This commit is contained in:
Pete Batard 2019-04-10 12:17:47 +01:00
parent d4a663991b
commit 38d82612cd
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 24 additions and 22 deletions

View file

@ -354,7 +354,7 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr
// Need to get the current file pointer in case we need to retry
readFilePointer = SetFilePointerEx(hFile, liZero, &liFilePointer, FILE_CURRENT);
if (!readFilePointer)
uprintf("Warning: Could not read file pointer: %s", WindowsErrorString());
uprintf("Warning: Could not read file pointer %s", WindowsErrorString());
if (nNumRetries == 0)
nNumRetries = 1;
@ -375,7 +375,7 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr
}
uprintf("Wrote %d bytes but requested %d", *lpNumberOfBytesWritten, nNumberOfBytesToWrite);
} else {
uprintf("Write error [0x%08X]", GetLastError());
uprintf("Write error %s", WindowsErrorString());
LastWriteError = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|GetLastError();
}
// If we can't reposition for the next run, just abort