summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-19 10:13:15 (GMT)
committerGeorg Brandl <georg@python.org>2008-07-19 10:13:15 (GMT)
commit8494d573b97f268e79500f5b19a36c8d8e050aac (patch)
treec2c9691a381c79049f3171ee067b5cedb0105e7e /Python
parent59f8d83b33bcda5edb507f6135b7a5dfcaf5b1b2 (diff)
downloadcpython-8494d573b97f268e79500f5b19a36c8d8e050aac.zip
cpython-8494d573b97f268e79500f5b19a36c8d8e050aac.tar.gz
cpython-8494d573b97f268e79500f5b19a36c8d8e050aac.tar.bz2
#3368: free string allocated by "es" ParseTuple format.
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 7ad3bf9..a43bd43 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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)) {