Skip to content

Commit 70e9525

Browse files
authored
Merge pull request #38 from libxengine/autofix/high/alert-40
[Autofix][high] Alert #40: Incorrect allocation-error handling
2 parents e50760d + ad00485 commit 70e9525

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

XEngine_Source/XEngine_ModuleSession/ModuleSession_PushStream/ModuleSession_PushStream.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 "ModuleSession_PushStream.h"
3+
#include <new>
34
/********************************************************************
45
// Created: 2023/06/04 20:19:13
56
// File Name: D:\XEngine_StreamMedia\XEngine_Source\XEngine_ModuleSession\ModuleSession_PushStream\ModuleSession_PushStream.cpp
@@ -54,7 +55,7 @@ bool CModuleSession_PushStream::ModuleSession_PushStream_Create(LPCXSTR lpszClie
5455
return false;
5556
}
5657
//申请内存
57-
PUSHSTREAM_PACKET* pSt_Packet = new PUSHSTREAM_PACKET;
58+
PUSHSTREAM_PACKET* pSt_Packet = new(std::nothrow) PUSHSTREAM_PACKET;
5859
if (NULL == pSt_Packet)
5960
{
6061
Session_IsErrorOccur = true;

0 commit comments

Comments
 (0)