PATCH: Fix resource leak in cygpath.cc
Sat Mar 31 00:08:00 GMT 2007
On Fri, Mar 30, 2007 at 03:42:26PM -0700, Mark Mitchell wrote:
>Mark Mitchell wrote:
>> The cygpath utility calls FindFirstFile, but never calls FindClose. As
>> a result, in leaks search handles. When you're using it for just one
>> file, that's not a big deal, but if you feed it enough files, it gets
>> unhappy. Also, if you've got a long running cygpath in one window, you
>> can't do file renames in named directories in another because cygpath
>> still has the handles open.
>> Here's a patch. I don't claim to have tested this in any comprehensive
>> way, but I've played with it, and it fixes the problems I've been seeing.
>> Hope this helps,
>Bleck! My first posting on this list, and I rudely attached the wrong
>file. I'm very sorry.
Heh. How dare you? :-)
>Here's the right one.
>2007-03-30 Mark Mitchell <firstname.lastname@example.org>
> * utils/cygpath.cc (get_long_path_name_w32impl): Close handles
> returned by FindFirstFile.
Thanks for fixing this embarrassing bug.
I've applied the patch.
More information about the Cygwin-patches