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
|
|
@ -81,6 +81,8 @@ void dthread_send_delta(int pnum, _cmd_id cmd, byte *pbSrc, int dwLen)
|
|||
}
|
||||
|
||||
pkt = static_cast<TMegaPkt *>(std::malloc(dwLen + 20));
|
||||
if (pkt == nullptr)
|
||||
app_fatal("Failed to allocate memory");
|
||||
pkt->pNext = nullptr;
|
||||
pkt->dwSpaceLeft = pnum;
|
||||
pkt->data[0] = static_cast<byte>(cmd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue