about summary refs log tree commit diff
path: root/src/network/gethostbyname2_r.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-02-02 01:32:12 -0500
committerRich Felker <dalias@aerifal.cx>2013-02-02 01:32:12 -0500
commitb0302863a36ef6ad24bd25e3ef4df74b9a56980d (patch)
tree3df6d8490c776af5799a6d7f473caa846cdf5678 /src/network/gethostbyname2_r.c
parent70b584bc9467ce939c73898212c17be1ab7e39af (diff)
downloadmusl-b0302863a36ef6ad24bd25e3ef4df74b9a56980d.tar.gz
musl-b0302863a36ef6ad24bd25e3ef4df74b9a56980d.tar.xz
musl-b0302863a36ef6ad24bd25e3ef4df74b9a56980d.zip
fix memory leak due to double call to getaddrinfo in gethostbyname*
Diffstat (limited to 'src/network/gethostbyname2_r.c')
-rw-r--r--src/network/gethostbyname2_r.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c
index 49e4e531..0dc6dc00 100644
--- a/src/network/gethostbyname2_r.c
+++ b/src/network/gethostbyname2_r.c
@@ -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;