Commit 6c913780 authored by Neal Norwitz's avatar Neal Norwitz

Fix some more memory leaks (in error conditions) introduced in r58455.

Also fix some indentation.
parent 4167ebcf
......@@ -2139,6 +2139,7 @@ posix_listdir(PyObject *self, PyObject *args)
Py_FileSystemDefaultEncoding, &name, &len))
return NULL;
if (len >= MAX_PATH) {
PyMem_Free(name);
PyErr_SetString(PyExc_ValueError, "path too long");
return NULL;
}
......@@ -2164,7 +2165,7 @@ posix_listdir(PyObject *self, PyObject *args)
if (rc != NO_ERROR) {
errno = ENOENT;
return posix_error_with_filename(name);
return posix_error_with_allocated_filename(name);
}
if (srchcnt > 0) { /* If Directory is NOT Totally Empty, */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment