Преглед на файлове

#IQRV #comment new[]变量释放缺陷修复

80374374 преди 1 година
родител
ревизия
e59587b96d
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      Module/include/CommEntityUtil.hpp

+ 2 - 2
Module/include/CommEntityUtil.hpp

@@ -667,7 +667,7 @@ static std::string W2S(const std::wstring wstr)
 		std::memset(str, 0, sizeof(char) * (n + 1));
 		::WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, &str[0], n, NULL, NULL);
 		std::string strr(str);
-		delete str;
+		delete [] str;
 		return strr;
 	}
 #else
@@ -689,7 +689,7 @@ static std::wstring S2W(const std::string str)
 		std::memset(wstr, 0, (n + 1) * sizeof(wchar_t));
 		::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, &wstr[0], n);
 		std::wstring strr(wstr);
-		delete wstr;
+		delete [] wstr;
 		return strr;
 	}
 #else