Subject: Re: A Windows handle leak in ares_init

Re: A Windows handle leak in ares_init

From: codemastr <codemstr_at_ptd.net>
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
> (http://groups-beta.google.com/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/e0abddb962b97e18/ec35934b0f4d84c4#ec35934b0f4d84c4)
>
> 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)
> http://support.microsoft.com/default.aspx?scid=kb;en-us;836769

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

_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Sat Jul 2 18:15:10 2005