Windows: fix leak in posix_listdir.
This commit is contained in:
parent
e71362d3de
commit
2a7feee76d
|
@ -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 != ':')
|
||||||
|
|
Loading…
Reference in New Issue