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
|
|
@ -60,6 +60,8 @@ void GetNextPacket()
|
|||
TMegaPkt *result;
|
||||
|
||||
sgpCurrPkt = static_cast<TMegaPkt *>(std::malloc(sizeof(TMegaPkt)));
|
||||
if (sgpCurrPkt == nullptr)
|
||||
app_fatal("Failed to allocate memory");
|
||||
sgpCurrPkt->pNext = nullptr;
|
||||
sgpCurrPkt->dwSpaceLeft = sizeof(result->data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue