[raknet] Match AllocPacket(...)

This commit is contained in:
RD42 2024-08-17 21:27:53 +08:00
parent edc7c6a9a0
commit dcfcaab9b0

View File

@ -143,9 +143,18 @@ Packet *AllocPacket(unsigned dataSize)
Packet *AllocPacket(unsigned dataSize, unsigned char *data)
{
Packet *p = (Packet *)malloc(sizeof(Packet));
p->data=data;
p->length=dataSize;
p->deleteData=true;
p->data=NULL;
p->length=0;
p->deleteData=false;
if(dataSize != 0)
{
if(data != NULL)
{
p->data=data;
p->length=dataSize;
p->deleteData=true;
}
}
return p;
}