#3368: free string allocated by "es" ParseTuple format.
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 @@
 
 	pathlen = strlen(path);
 	if (pathlen == 0) {
+		PyMem_Free(path);
 		PyErr_SetString(PyExc_ImportError, "empty pathname");
 		return -1;
 	} else {
@@ -3208,6 +3209,7 @@
 			rv = stat(mangled, &statbuf);
 		}
 #endif
+		PyMem_Free(path);
 		if (rv == 0) {
 			/* it exists */
 			if (S_ISDIR(statbuf.st_mode)) {