Get rid of unchecked calls to malloc

This commit is contained in:
Vladimir Olteanu 2021-07-12 03:25:59 +03:00 committed by Anders Jenbo
commit 7271e5558c
4 changed files with 8 additions and 2 deletions

View file

@ -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);