mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
zero out client memory on startup to prevent more bad surprises
This commit is contained in:
parent
9cf4facd05
commit
b25fc26c1c
|
@ -1,5 +1,6 @@
|
|||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#include <new>
|
||||
|
||||
#include <stdlib.h> // qsort
|
||||
#include <stdarg.h>
|
||||
|
@ -2165,7 +2166,12 @@ void CClient::RegisterCommands()
|
|||
m_pConsole->Chain("br_filter_serveraddress", ConchainServerBrowserUpdate, this);
|
||||
}
|
||||
|
||||
static CClient *CreateClient() { return new CClient(); }
|
||||
static CClient *CreateClient()
|
||||
{
|
||||
CClient *pClient = static_cast<CClient *>(mem_alloc(sizeof(CClient), 1));
|
||||
mem_zero(pClient, sizeof(CClient));
|
||||
return new(pClient) CClient;
|
||||
}
|
||||
|
||||
/*
|
||||
Server Time
|
||||
|
|
Loading…
Reference in a new issue