[issue18332] _posix_listdir may leak FD

2013-06-30 Thread Christian Heimes
Christian Heimes added the comment: You are right. -- resolution: -> duplicate status: open -> closed superseder: -> os.listdir() leaks FDs if invoked on FD pointing to a non-directory ___ Python tracker ___

[issue18332] _posix_listdir may leak FD

2013-06-30 Thread Richard Oudkerk
Richard Oudkerk added the comment: I think this is a duplicate of #17899. -- nosy: +sbt ___ Python tracker ___ ___ Python-bugs-list ma

[issue18332] _posix_listdir may leak FD

2013-06-30 Thread Christian Heimes
New submission from Christian Heimes: Under rare circumstances listdir() could leak a FD: - HAVE_FDOPENDIR is defined - dup(fd) succeeds - fdopendir() fails and sets dirp to NULL - if (dirp == NULL) goto exit - the dupped fd isn't closed because exit just handles dirp != NULL. Proposed fix: