Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d43ab05

Browse files
Issue python#29513: Fixed a reference leak in os.scandir() added in issue python#29034.
1 parent e185757 commit d43ab05

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

Modules/posixmodule.c

-7
Original file line numberDiff line numberDiff line change
@@ -11865,7 +11865,6 @@ ScandirIterator_finalize(ScandirIterator *iterator)
1186511865
}
1186611866
}
1186711867

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

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

11972-
/* path_converter doesn't keep path.object around, so do it
11973-
manually for the lifetime of the iterator here (the refcount
11974-
is decremented in ScandirIterator_dealloc)
11975-
*/
11976-
Py_XINCREF(iterator->path.object);
11977-
1197811971
#ifdef MS_WINDOWS
1197911972
iterator->first_time = 1;
1198011973

0 commit comments

Comments
 (0)