diff Python/import.c @ 31779:ec37cb1c0ed8 2.3

Decref all if ensure_fromlist fails. Fixes #876533.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 23 Mar 2004 16:28:45 +0000
parents 6f15e73b59f2
children 6d7d00bf1aae
line wrap: on
line diff
--- a/Python/import.c	Mon Mar 22 20:41:47 2004 +0000
+++ b/Python/import.c	Tue Mar 23 16:28:45 2004 +0000
@@ -2178,9 +2178,10 @@
 			if (all == NULL)
 				PyErr_Clear();
 			else {
-				if (!ensure_fromlist(mod, all, buf, buflen, 1))
+				int ret = ensure_fromlist(mod, all, buf, buflen, 1);
+				Py_DECREF(all);
+				if (!ret)
 					return 0;
-				Py_DECREF(all);
 			}
 			continue;
 		}