mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
#3368: free string allocated by "es" ParseTuple format.
This commit is contained in:
parent
59f8d83b33
commit
8494d573b9
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||||
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)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue