fix memory leak due to double call to getaddrinfo in gethostbyname*
authorRich Felker <dalias@aerifal.cx>
Sat, 2 Feb 2013 06:32:12 +0000 (01:32 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 2 Feb 2013 06:32:12 +0000 (01:32 -0500)
src/network/gethostbyname2_r.c

index 49e4e53197d195d83a91ee4605c0cea7e5c8e9fa..0dc6dc00d62ccb7e7174d4ab9cf869818a797eb8 100644 (file)
@@ -30,7 +30,6 @@ int gethostbyname2_r(const char *name, int af,
                buflen -= sizeof(char *)-i;
        }
 
-       getaddrinfo(name, 0, &hint, &ai);
        switch (getaddrinfo(name, 0, &hint, &ai)) {
        case EAI_NONAME:
                *err = HOST_NOT_FOUND;