]> granicus.if.org Git - python/commitdiff
Windows: fix leak in posix_listdir.
authorStefan Krah <stefan@bytereef.org>
Sat, 27 Nov 2010 22:06:49 +0000 (22:06 +0000)
committerStefan Krah <stefan@bytereef.org>
Sat, 27 Nov 2010 22:06:49 +0000 (22:06 +0000)
Modules/posixmodule.c

index be99be86516a816cb63d8e3a7b9a2db504b68568..3197a0d2d8dfb8ebaf439738788fd85a0214b8ce 100644 (file)
@@ -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 != ':')