diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f77832dbe69..03fae255c32 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1855,6 +1855,7 @@ posix_listdir(PyObject *self, PyObject *args) free(wnamebuf); return NULL; } + free(wnamebuf); return d; } /* Drop the argument parsing error as narrow strings