Commit cb5e25c4 authored by Georg Brandl's avatar Georg Brandl

#3368: free string allocated by "es" ParseTuple format.

parent 23342230
......@@ -3187,6 +3187,7 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
pathlen = strlen(path);
if (pathlen == 0) {
PyMem_Free(path);
PyErr_SetString(PyExc_ImportError, "empty pathname");
return -1;
} else {
......@@ -3208,6 +3209,7 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
rv = stat(mangled, &statbuf);
}
#endif
PyMem_Free(path);
if (rv == 0) {
/* it exists */
if (S_ISDIR(statbuf.st_mode)) {
......
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