PATCH: Fix resource leak in cygpath.cc

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


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,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygpath.cc
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20070330/1dd78aa2/attachment.cc>


More information about the Cygwin-patches mailing list