Skip to content

Commit 1ac7c38

Browse files
authored
Merge pull request #1 from libxengine/autofix/high/alert-35
[Autofix][high] Alert #35: Incorrect allocation-error handling
2 parents ed8fa92 + 89249b5 commit 1ac7c38

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "pch.h"
22
#include "ModuleConfigure_Json.h"
3+
#include <new>
34
/********************************************************************
45
// Created: 2021/12/02 16:14:11
56
// File Name: D:\XEngine_ServiceApp\XEngine_Source\XEngine_ModuleConfigure\ModuleConfigure_Json\ModuleConfigure_Json.cpp
@@ -170,7 +171,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_Version(LPCXSTR lpszConfigFile,
170171
}
171172
Json::Value st_JsonXVer = st_JsonRoot["XVersionList"];
172173

173-
pSt_ServerConfig->st_XVer.pStl_ListVer = new list<string>;
174+
pSt_ServerConfig->st_XVer.pStl_ListVer = new(std::nothrow) list<string>;
174175
if (NULL == pSt_ServerConfig->st_XVer.pStl_ListVer)
175176
{
176177
Config_IsErrorOccur = true;

0 commit comments

Comments
 (0)