Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8494d57

Browse files
committed
#3368: free string allocated by "es" ParseTuple format.
1 parent 59f8d83 commit 8494d57

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Python/import.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,6 +3187,7 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
31873187

31883188
pathlen = strlen(path);
31893189
if (pathlen == 0) {
3190+
PyMem_Free(path);
31903191
PyErr_SetString(PyExc_ImportError, "empty pathname");
31913192
return -1;
31923193
} else {
@@ -3208,6 +3209,7 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
32083209
rv = stat(mangled, &statbuf);
32093210
}
32103211
#endif
3212+
PyMem_Free(path);
32113213
if (rv == 0) {
32123214
/* it exists */
32133215
if (S_ISDIR(statbuf.st_mode)) {

0 commit comments

Comments
 (0)