diff Python/import.c @ 37488:4b761a63399c legacy-trunk

Fix refleak in __import__("") (probably the cause of the 2 refleaks in test_builtin.)
author Thomas Wouters <thomas@python.org>
date Wed, 05 Apr 2006 13:39:37 +0000
parents 20ffc2ca03e0
children 2f3f2e32dfd9
line wrap: on
line diff
--- a/Python/import.c	Wed Apr 05 13:24:26 2006 +0000
+++ b/Python/import.c	Wed Apr 05 13:39:37 2006 +0000
@@ -1938,6 +1938,8 @@
 		/* If tail is Py_None, both get_parent and load_next found
 		   an empty module name: someone called __import__("") or
 		   doctored faulty bytecode */
+		Py_DECREF(tail);
+		Py_DECREF(head);
 		PyErr_SetString(PyExc_ValueError,
 				"Empty module name");
 		return NULL;