Get rid of unchecked calls to malloc
This commit is contained in:
parent
d2048c7ac0
commit
7271e5558c
4 changed files with 8 additions and 2 deletions
|
|
@ -38,6 +38,8 @@ void tmsg_add(byte *pbMsg, uint8_t bLen)
|
|||
TMsg **tail;
|
||||
|
||||
TMsg *msg = static_cast<TMsg *>(std::malloc(bLen + sizeof(*msg)));
|
||||
if (msg == nullptr)
|
||||
app_fatal("Failed to allocate memory");
|
||||
msg->hdr.pNext = nullptr;
|
||||
msg->hdr.dwTime = SDL_GetTicks() + gnTickDelay * 10;
|
||||
msg->hdr.bLen = bLen;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue