This is the mail archive of the
mailing list for the Cygwin project.
Re: find(1) memory leak in cygheap
Oh, btw., please http://cygwin.com/acronyms/#PCYMTNQREAIYR
On Aug 20 13:19, Corinna Vinschen wrote:
> On Aug 20 18:23, Haojun Bao wrote:
> > Great. In fact, I also found this code myself might cause problem in path.h:
> > (we should test if path is NULL, and free it before the memcpy, and
> > other member pointers should also be checked and free-ed first, is it
> > about right?:-)
> Yes and no. It might look cleaner to free the pointers at this point
> if they are non-NULL, but in fact the operator= is called after the
> path_conv content has been memcpy'ed to another fhandler. So, if you
> free the pointers, you free the pointers of another file descriptor.
> SEGV's galore!
...which means, path_conv::operator= should only be called for
uninitialized fhandlers. It would be a bug in Cygwin if it's called on
an already initialized fhandler (with the well known result).
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple