From 908ce5734b06bcabd8123876fa8c46b261b90d74 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 17 May 2009 22:16:58 +0000 Subject: [PATCH] fix an addrinfo leak when getaddrinfo returns an addrinfo that is not inet or inet6 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8975 d7cf8633-e32d-0410-b094-e92efae38249 --- lhnet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lhnet.c b/lhnet.c index f51ea3a9..dfb00050 100644 --- a/lhnet.c +++ b/lhnet.c @@ -151,7 +151,10 @@ int LHNETADDRESS_Resolve(lhnetaddressnative_t *address, const char *name, int po if (err != 0 || addrinf == NULL) return 0; if (addrinf->ai_addr->sa_family != AF_INET6 && addrinf->ai_addr->sa_family != AF_INET) + { + freeaddrinfo (addrinf); return 0; + } // great it worked if (addrinf->ai_addr->sa_family == AF_INET6) -- 2.39.2