]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix an addrinfo leak when getaddrinfo returns an addrinfo that is not
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 May 2009 22:16:58 +0000 (22:16 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 May 2009 22:16:58 +0000 (22:16 +0000)
inet or inet6

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8975 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c

diff --git a/lhnet.c b/lhnet.c
index f51ea3a922b23595291615e0d469682339fe125f..dfb0005071f9f0dccfe2ed88f48ca8f9eda30787 100644 (file)
--- 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)