explicitly call memory management functions in net_ * files

This commit is contained in:
Roman Fomin 2021-12-08 13:13:37 +07:00
parent d4610e111c
commit 069a4e5c10
3 changed files with 7 additions and 7 deletions

View File

@ -465,10 +465,10 @@ static void NET_CL_ParseSYN(net_packet_t *packet)
static void SetRejectReason(const char *s)
{
free(net_client_reject_reason);
(free)(net_client_reject_reason);
if (s != NULL)
{
net_client_reject_reason = strdup(s);
net_client_reject_reason = (strdup)(s);
}
else
{

View File

@ -151,7 +151,7 @@ static void NET_Conn_ParseReliableACK(net_connection_t *conn, net_packet_t *pack
conn->reliable_packets = rp->next;
NET_FreePacket(rp->packet);
free(rp);
(free)(rp);
}
}
@ -383,7 +383,7 @@ net_packet_t *NET_Conn_NewReliable(net_connection_t *conn, int packet_type)
// Add to the list of reliable packets
rp = malloc(sizeof(net_reliable_packet_t));
rp = (malloc)(sizeof(net_reliable_packet_t));
rp->packet = packet;
rp->next = NULL;
rp->seq = conn->reliable_send_seq;

View File

@ -226,7 +226,7 @@ static query_target_t *GetTargetForAddr(net_addr_t *addr, boolean create)
return NULL;
}
targets = realloc(targets, sizeof(query_target_t) * (num_targets + 1));
targets = (realloc)(targets, sizeof(query_target_t) * (num_targets + 1));
target = &targets[num_targets];
target->type = QUERY_TARGET_SERVER;
@ -248,7 +248,7 @@ static void FreeTargets(void)
{
NET_ReleaseAddress(targets[i].addr);
}
free(targets);
(free)(targets);
targets = NULL;
num_targets = 0;
}
@ -588,7 +588,7 @@ void NET_Query_Init(void)
net_sdl_module.InitClient();
}
free(targets);
(free)(targets);
targets = NULL;
num_targets = 0;