summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-03-23 16:28:13 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-03-23 16:28:13 (GMT)
commit83969eeeeb08fa27d8564303792107750ff09598 (patch)
tree33b9817af1bc844681766070f453f85700660ab0 /Python
parent05f842bae280914ce37a7ce2774bcc25cfaf4814 (diff)
downloadcpython-83969eeeeb08fa27d8564303792107750ff09598.zip
cpython-83969eeeeb08fa27d8564303792107750ff09598.tar.gz
cpython-83969eeeeb08fa27d8564303792107750ff09598.tar.bz2
Decref all if ensure_fromlist fails. Fixes #876533.
Backported to 2.3.
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index e6ea3dd..5b9f162 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2104,9 +2104,10 @@ ensure_fromlist(PyObject *mod, PyObject *fromlist, char *buf, int buflen,
if (all == NULL)
PyErr_Clear();
else {
- if (!ensure_fromlist(mod, all, buf, buflen, 1))
- return 0;
+ int ret = ensure_fromlist(mod, all, buf, buflen, 1);
Py_DECREF(all);
+ if (!ret)
+ return 0;
}
continue;
}