diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-03-23 16:28:45 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-03-23 16:28:45 (GMT) |
commit | 886756f35a7ca0024a358bf2330c4b415d7a7554 (patch) | |
tree | 63b12599aa07fb283b67b839fc9ff3a4e954664e /Python/import.c | |
parent | c7ccc240296ced487eac351fadec61983da24e7b (diff) | |
download | cpython-886756f35a7ca0024a358bf2330c4b415d7a7554.zip cpython-886756f35a7ca0024a358bf2330c4b415d7a7554.tar.gz cpython-886756f35a7ca0024a358bf2330c4b415d7a7554.tar.bz2 |
Decref all if ensure_fromlist fails. Fixes #876533.
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c index 6e97899..670e603 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2178,9 +2178,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; } |