diff --git a/Log.cpp b/Log.cpp index dc90f47..f9c6db5 100644 --- a/Log.cpp +++ b/Log.cpp @@ -371,12 +371,12 @@ bool CVersionInfo::GetModuleVersionInfo(HMODULE hMod) { modFileName = new TCHAR[MAX_PATH]; retVal = GetModuleFileName(hMod, modFileName, MAX_PATH); if (!retVal) { - delete modFileName; + delete[] modFileName; ::WriteToLog(L"CLog::GetModuleVersion - Error while getting module filename..."); return false; } retVal = GetModuleVersionInfo(modFileName); - delete modFileName; + delete[] modFileName; return (retVal == TRUE); } @@ -413,7 +413,7 @@ bool CVersionInfo::GetModuleVersionInfo(LPTSTR modName = NULL) { if (retVal) this->g_bVerInfoBuff = buff; else - if (buff) delete buff; + delete[] buff; return (retVal == TRUE); } diff --git a/stdafx.cpp b/stdafx.cpp index 1b2c84b..1122223 100644 --- a/stdafx.cpp +++ b/stdafx.cpp @@ -105,7 +105,7 @@ bool FileExists(LPTSTR fileName) { h = FindFirstFile(searchPath, &wfData); if (colonPtr) colonPtr[0] = ':'; if (h != INVALID_HANDLE_VALUE) { - delete searchPath; + delete[] searchPath; FindClose(h); return true; } @@ -117,7 +117,7 @@ bool FileExists(LPTSTR fileName) { } wcscat_s(searchPath, strMaxSize, L"*.*"); h = FindFirstFile(searchPath, &wfData); - delete searchPath; + delete[] searchPath; if (h != INVALID_HANDLE_VALUE) { FindClose(h); return true;