Windows: fix leak in posix_listdir.

This commit is contained in:
Stefan Krah 2010-11-27 22:06:49 +00:00
parent e71362d3de
commit 2a7feee76d
1 changed files with 1 additions and 0 deletions

View File

@ -2396,6 +2396,7 @@ posix_listdir(PyObject *self, PyObject *args)
} }
strcpy(namebuf, PyBytes_AsString(opath)); strcpy(namebuf, PyBytes_AsString(opath));
len = PyObject_Size(opath); len = PyObject_Size(opath);
Py_DECREF(opath);
if (len > 0) { if (len > 0) {
char ch = namebuf[len-1]; char ch = namebuf[len-1];
if (ch != SEP && ch != ALTSEP && ch != ':') if (ch != SEP && ch != ALTSEP && ch != ':')