From b4fb820b7b2e4f357ea252e75ab578faacfdc0bc Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Fri, 8 May 2026 09:49:48 +0000 Subject: [PATCH] Potential fix for code scanning alert no. 71 Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../BTorrent_Creator/BTorrent_Creator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp b/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp index 30c1fa3..3172f82 100644 --- a/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp +++ b/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "BTorrent_Creator.h" +#include /******************************************************************** // Created: 2023/02/02 16:26:25 // File Name: D:\XEngine\XEngine_SourceCode\XEngine_NetHelp\NetHelp_BTorrent\BTorrent_Creator\BTorrent_Creator.cpp @@ -49,7 +50,7 @@ XHANDLE CBTorrent_Creator::BTorrent_Creator_Init(LPCXSTR lpszBTPath, int nPieceS return NULL; } //申请空间 - BTORRENT_CREATORINFO* pSt_BTCreator = new BTORRENT_CREATORINFO; + BTORRENT_CREATORINFO* pSt_BTCreator = new(std::nothrow) BTORRENT_CREATORINFO; if (NULL == pSt_BTCreator) { BTDload_IsErrorOccur = true; @@ -58,9 +59,9 @@ XHANDLE CBTorrent_Creator::BTorrent_Creator_Init(LPCXSTR lpszBTPath, int nPieceS } *pSt_BTCreator = {}; //申请内存 - pSt_BTCreator->pStl_ListNode = new list; - pSt_BTCreator->pStl_ListSeeds = new list; - pSt_BTCreator->pStl_ListTracker = new list; + pSt_BTCreator->pStl_ListNode = new(std::nothrow) list; + pSt_BTCreator->pStl_ListSeeds = new(std::nothrow) list; + pSt_BTCreator->pStl_ListTracker = new(std::nothrow) list; if ((NULL == pSt_BTCreator->pStl_ListNode) || (NULL == pSt_BTCreator->pStl_ListSeeds) || (NULL == pSt_BTCreator->pStl_ListTracker)) { BTDload_IsErrorOccur = true;