make sure allocated data ptr in null (not garbage)

This commit is contained in:
otavepto 2024-04-10 08:00:19 +02:00
parent d802dba47d
commit 048b9a94cd

View File

@ -109,6 +109,7 @@ SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer )
if (cbAllocateBuffer < 0) if (cbAllocateBuffer < 0)
cbAllocateBuffer = 0; cbAllocateBuffer = 0;
pMsg->m_pData = nullptr;
if (cbAllocateBuffer) if (cbAllocateBuffer)
pMsg->m_pData = malloc(cbAllocateBuffer); pMsg->m_pData = malloc(cbAllocateBuffer);