From cb5c4e482e95e646c68fd0ab80f8a00e4371199c Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 29 Oct 2025 16:24:44 +0100 Subject: [PATCH] SOCK_GetAddr: freeaddrinfo does not need to be called on getaddrinfo failure --- src/i_tcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index 2690bbc7e..18c20dd5d 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1271,7 +1271,7 @@ void I_ShutdownTcpDriver(void) static boolean SOCK_GetAddr(mysockaddr_t *sin, const char *address, const char *port, boolean test) { - addrinfo_t *ai = NULL, *runp, hints; + addrinfo_t *ai, *runp, hints; int gaie; size_t i; @@ -1287,10 +1287,7 @@ static boolean SOCK_GetAddr(mysockaddr_t *sin, const char *address, const char * gaie = getaddrinfo(address, port, &hints, &ai); if (gaie != 0) - { - freeaddrinfo(ai); return false; - } runp = ai;