diff options
-rw-r--r-- | Modules/posixmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index be99be8651..3197a0d2d8 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2396,6 +2396,7 @@ posix_listdir(PyObject *self, PyObject *args) } strcpy(namebuf, PyBytes_AsString(opath)); len = PyObject_Size(opath); + Py_DECREF(opath); if (len > 0) { char ch = namebuf[len-1]; if (ch != SEP && ch != ALTSEP && ch != ':') |