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