]> granicus.if.org Git - python/commitdiff
#3368: free string allocated by "es" ParseTuple format.
authorGeorg Brandl <georg@python.org>
Sat, 19 Jul 2008 10:13:15 +0000 (10:13 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 19 Jul 2008 10:13:15 +0000 (10:13 +0000)
Python/import.c

index 7ad3bf9bcb03386c8d1a3f3262ac549dd58618a6..a43bd43a57a4d1101b1fb0c6087323492930a852 100644 (file)
@@ -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)) {