From: Martin v. Löwis Date: Tue, 23 Mar 2004 16:28:13 +0000 (+0000) Subject: Decref all if ensure_fromlist fails. Fixes #876533. X-Git-Tag: v2.4a1~600 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83969eeeeb08fa27d8564303792107750ff09598;p=thirdparty%2FPython%2Fcpython.git Decref all if ensure_fromlist fails. Fixes #876533. Backported to 2.3. --- diff --git a/Python/import.c b/Python/import.c index e6ea3dd0a958..5b9f16238732 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; }