Comment 7 for bug 297831

Revision history for this message
Martin Pool (mbp) wrote :

Thanks for identifying the problem and for the patch, Harry.

As it stands that patch can leak the allocated memory if one of the operations fails.

It seems to me it would actually be easier to open a file descriptor on '.' before leaving it and then fchdir back to it at the end. That would possibly be faster than copying the names around.

It would be even better to not bother with going back to the original location until we're done scanning all the directories but that might be a larger change.