mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 08:17:35 +02:00
don't alloc memory for checkInPacket, make it stack to function
This commit is contained in:
parent
968544152f
commit
9dbbf8c65c
1 changed files with 3 additions and 5 deletions
|
@ -495,7 +495,7 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
NUM_BYTES_RFC4122_UUID + (2 * (sizeof(uint16_t) + IP_ADDRESS_BYTES)) +
|
||||
numBytesNodesOfInterest + sizeof(unsigned char);
|
||||
|
||||
unsigned char* checkInPacket = new unsigned char[numPacketBytes];
|
||||
unsigned char checkInPacket[numPacketBytes];
|
||||
unsigned char* packetPosition = checkInPacket;
|
||||
|
||||
PACKET_TYPE nodePacketType = (memchr(SOLO_NODE_TYPES, _ownerType, sizeof(SOLO_NODE_TYPES)))
|
||||
|
@ -534,8 +534,6 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
_nodeSocket.send(_domainIP.toString().toLocal8Bit().constData(), _domainPort, checkInPacket,
|
||||
packetPosition - checkInPacket);
|
||||
|
||||
delete[] checkInPacket; // clean up
|
||||
|
||||
const int NUM_DOMAIN_SERVER_CHECKINS_PER_STUN_REQUEST = 5;
|
||||
static unsigned int numDomainCheckins = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue