Skip to content

Commit

Permalink
Issue python#29513: Fixed a reference leak in os.scandir() added in i…
Browse files Browse the repository at this point in the history
…ssue python#29034.
  • Loading branch information
serhiy-storchaka committed Feb 9, 2017
1 parent e185757 commit d43ab05
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11865,7 +11865,6 @@ ScandirIterator_finalize(ScandirIterator *iterator)
}
}

Py_CLEAR(iterator->path.object);
path_cleanup(&iterator->path);

/* Restore the saved exception. */
Expand Down Expand Up @@ -11969,12 +11968,6 @@ posix_scandir(PyObject *self, PyObject *args, PyObject *kwargs)
path_converter, &iterator->path))
goto error;

/* path_converter doesn't keep path.object around, so do it
manually for the lifetime of the iterator here (the refcount
is decremented in ScandirIterator_dealloc)
*/
Py_XINCREF(iterator->path.object);

#ifdef MS_WINDOWS
iterator->first_time = 1;

Expand Down

0 comments on commit d43ab05

Please sign in to comment.