summaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-06-04 21:04:14 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-06-04 21:04:14 +0000
commit8629620b1cb7b3980fa26201c34f8c9756d16e24 (patch)
treedb3c671a39ff65094e52d30ac014a1eadcb4031b /ares
parent25d2a27c647eb387614f7a1c255fc9b952330359 (diff)
downloadcurl-8629620b1cb7b3980fa26201c34f8c9756d16e24.tar.gz
fix the bad bad bad mess this caused on name resolves returning more than
one name... Reported by James Bursa
Diffstat (limited to 'ares')
-rw-r--r--ares/ares_free_hostent.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ares/ares_free_hostent.c b/ares/ares_free_hostent.c
index d6cf51f4a..d76679565 100644
--- a/ares/ares_free_hostent.c
+++ b/ares/ares_free_hostent.c
@@ -33,10 +33,8 @@ void ares_free_hostent(struct hostent *host)
for (p = host->h_aliases; *p; p++)
free(*p);
free(host->h_aliases);
- for(p = host->h_addr_list; *p; p++)
- {
- free(*p);
- }
+ free(host->h_addr_list[0]); /* no matter if there is one or many entries,
+ there is only one malloc for all of them */
free(host->h_addr_list);
free(host);
}