From 069a4e5c102a3ec2402a1782b9506b41f5b3b216 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Wed, 8 Dec 2021 13:13:37 +0700 Subject: [PATCH] explicitly call memory management functions in net_ * files --- Source/net_client.c | 4 ++-- Source/net_common.c | 4 ++-- Source/net_query.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/net_client.c b/Source/net_client.c index 70096fa6..825da993 100644 --- a/Source/net_client.c +++ b/Source/net_client.c @@ -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 { diff --git a/Source/net_common.c b/Source/net_common.c index 56d15acb..26e2aef6 100644 --- a/Source/net_common.c +++ b/Source/net_common.c @@ -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; diff --git a/Source/net_query.c b/Source/net_query.c index a5cab894..264b2551 100644 --- a/Source/net_query.c +++ b/Source/net_query.c @@ -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;