Subject: Re: A Windows handle leak in ares_init

Re: A Windows handle leak in ares_init

From: Daniel Stenberg <daniel_at_haxx.se>
Date: 2005-07-01

On Wed, 29 Jun 2005, Shmulik Regev wrote:

> I debugged it and as it turns out the call to GetNetworkParams (in the
> function get_iphlpapi_dns_info) leaks a handle. I couldn't figure out how to
> deallocate it using standard Windows API (admittedly I wasn't thorough in my
> searching for it). Possibly, it is not intended to be frequently called. If
> so, I would assume there are two work-arounds: 1. modify the ares_init code
> to cache the result and share it among channels 2. allocate a fixed number
> of channels and reuse them.

Nothing in the Microsoft online docs suggests that this would need to be freed
in any way:

   http://msdn.microsoft.com/library/en-us/iphlp/iphlp/getnetworkparams.asp

Are you *sure* this is the function that leaks?

-- 
   c-ares -- my preferred DNS asynch resolver library
_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Fri Jul 1 00:09:38 2005