PATCH: Fix resource leak in cygpath.cc

Mark Mitchell mark@codesourcery.com
Fri Mar 30 22:42:00 GMT 2007


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.

Here's the right one.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygpath.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20070330/3f1020da/attachment.ksh>


More information about the Cygwin-patches mailing list