diff Python/import.c @ 8613:e3d3bbbd93f3 legacy-trunk

Fix two smal memory leaks discovered by Vadim Chugunov.
author Guido van Rossum <guido@python.org>
date Wed, 01 Jul 1998 17:36:26 +0000
parents 35a2151fb1c3
children bd47ee068b83
line wrap: on
line diff
--- a/Python/import.c	Wed Jul 01 15:49:56 1998 +0000
+++ b/Python/import.c	Wed Jul 01 17:36:26 1998 +0000
@@ -779,7 +779,6 @@
 	if (fp != NULL)
 		fclose(fp);
   cleanup:
-	Py_XINCREF(m);
 	Py_XDECREF(path);
 	Py_XDECREF(file);
 	return m;
@@ -1712,8 +1711,8 @@
 		}
 
 		buf[0] = '\0';
-		fdp = find_module(subname, path,
-				  buf, MAXPATHLEN+1, &fp);
+		fdp = find_module(subname, path, buf, MAXPATHLEN+1, &fp);
+		Py_XDECREF(path);
 		if (fdp == NULL) {
 			if (!PyErr_ExceptionMatches(PyExc_ImportError))
 				return NULL;