From f1cca2b59367c738a18617e4c4552f208ac8f5c2 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 4 Mar 2008 22:29:44 +0000 Subject: Fix refleak in chain(). --- Modules/itertoolsmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 76c8484..d8e14d0 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -1682,8 +1682,8 @@ chain_next(chainobject *lz) return NULL; /* no more input sources */ } lz->active = PyObject_GetIter(iterable); + Py_DECREF(iterable); if (lz->active == NULL) { - Py_DECREF(iterable); Py_CLEAR(lz->source); return NULL; /* input not iterable */ } -- cgit v0.12