From f2aa3b21e0e1c665414e707ba9c3414d264ad4bf Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Mon, 24 Jul 2006 15:58:33 +0000 Subject: Use the proper Curl_freeaddrinfo() for CURLRES_ARES. --- lib/hostares.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/hostares.c') diff --git a/lib/hostares.c b/lib/hostares.c index af1513ca2..1842d5f4f 100644 --- a/lib/hostares.c +++ b/lib/hostares.c @@ -298,6 +298,22 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, * The rest of this file is copied from hostip4.c. (needed for the * combination USE_ARES and ENABLE_IPV6). */ +/* + * This is a function for freeing name information in a protocol independent + * way. + */ +void Curl_freeaddrinfo(Curl_addrinfo *ai) +{ + Curl_addrinfo *next; + + /* walk over the list and free all entries */ + while(ai) { + next = ai->ai_next; + free(ai); + ai = next; + } +} + struct namebuf { struct hostent hostentry; char *h_addr_list[2]; -- cgit v1.2.3