Loading lib/easy.c +1 −1 Original line number Diff line number Diff line Loading @@ -238,7 +238,7 @@ CURLcode curl_easy_perform(CURL *curl) data->hostcache = Curl_global_host_cache_get(); } else { data->hostcache = Curl_hash_alloc(7, Curl_freeaddrinfo); data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo); } } Loading lib/hostip.c +15 −7 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ static Curl_addrinfo *my_getaddrinfo(struct SessionHandle *data, void Curl_global_host_cache_init(void) { if (!host_cache_initialized) { Curl_hash_init(&hostname_cache, 7, Curl_freeaddrinfo); Curl_hash_init(&hostname_cache, 7, Curl_freednsinfo); host_cache_initialized = 1; } } Loading Loading @@ -287,17 +287,25 @@ struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data, /* * This is a wrapper function for freeing name information in a protocol * independent way. This takes care of using the appropriate underlaying * proper function. * function. */ void Curl_freeaddrinfo(void *freethis) void Curl_freeaddrinfo(Curl_addrinfo *p) { struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; #ifdef ENABLE_IPV6 freeaddrinfo(p->addr); freeaddrinfo(p); #else free(p->addr); free(p); #endif } /* * Free a cache dns entry. */ void Curl_freednsinfo(void *freethis) { struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; Curl_freeaddrinfo(p->addr); free(p); } Loading lib/hostip.h +4 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,10 @@ struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data, void Curl_scan_cache_used(void *user, void *ptr); /* free name info */ void Curl_freeaddrinfo(void *freethis); void Curl_freeaddrinfo(Curl_addrinfo *freeaddr); /* free cached name info */ void Curl_freednsinfo(void *freethis); #ifdef MALLOCDEBUG void curl_freeaddrinfo(struct addrinfo *freethis, Loading Loading
lib/easy.c +1 −1 Original line number Diff line number Diff line Loading @@ -238,7 +238,7 @@ CURLcode curl_easy_perform(CURL *curl) data->hostcache = Curl_global_host_cache_get(); } else { data->hostcache = Curl_hash_alloc(7, Curl_freeaddrinfo); data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo); } } Loading
lib/hostip.c +15 −7 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ static Curl_addrinfo *my_getaddrinfo(struct SessionHandle *data, void Curl_global_host_cache_init(void) { if (!host_cache_initialized) { Curl_hash_init(&hostname_cache, 7, Curl_freeaddrinfo); Curl_hash_init(&hostname_cache, 7, Curl_freednsinfo); host_cache_initialized = 1; } } Loading Loading @@ -287,17 +287,25 @@ struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data, /* * This is a wrapper function for freeing name information in a protocol * independent way. This takes care of using the appropriate underlaying * proper function. * function. */ void Curl_freeaddrinfo(void *freethis) void Curl_freeaddrinfo(Curl_addrinfo *p) { struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; #ifdef ENABLE_IPV6 freeaddrinfo(p->addr); freeaddrinfo(p); #else free(p->addr); free(p); #endif } /* * Free a cache dns entry. */ void Curl_freednsinfo(void *freethis) { struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; Curl_freeaddrinfo(p->addr); free(p); } Loading
lib/hostip.h +4 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,10 @@ struct Curl_dns_entry *Curl_resolv(struct SessionHandle *data, void Curl_scan_cache_used(void *user, void *ptr); /* free name info */ void Curl_freeaddrinfo(void *freethis); void Curl_freeaddrinfo(Curl_addrinfo *freeaddr); /* free cached name info */ void Curl_freednsinfo(void *freethis); #ifdef MALLOCDEBUG void curl_freeaddrinfo(struct addrinfo *freethis, Loading