Subject: Re: A Windows handle leak in ares_init

Re: A Windows handle leak in ares_init

From: codemastr <>
Date: 2005-07-02

>> Are you *sure* this is the function that leaks?
> I'm pretty sure it is. Please view my report at an MS newsgroup
> (
> One of the subscribers (Tom G.) mentioned that it is a known MS bug,
> though they thought it happens only with Win 2003 (my experience is
> with XP SP 2)

You seem to absolutely be correct, good catch! I agree with the "solution"
they suggest on that thread. We should simply load the .dll once (a static
variable basically), rather than each time the function is called. Rather
than leaking N handles, this would make us leak 1. It doesn't really solve
the problem, but it's a bit better. We should also be sure to inform
Microsoft that this problem affects XP as well and perhaps try and get some
people to agree to test the hotfix so that they release it as an actual
patch rather than something you need to call them on the phone to get.

Dominick Meglio

Received on Sat Jul 2 18:15:10 2005