SOCK_GetAddr: freeaddrinfo does not need to be called on getaddrinfo failure

This commit is contained in:
Alug committed 2025-10-30 18:03:43 +01:00
1 parent db2062ed1d
commit cb5c4e482e
1 file changed
+1 -4
+1 -4
View File
@@ -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;