commit | f1cca2b59367c738a18617e4c4552f208ac8f5c2 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Tue Mar 04 22:29:44 2008 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Tue Mar 04 22:29:44 2008 +0000 |
tree | 1259061f364e42ea7819debe4b5b66ba09a69a10 | |
parent | a28df13a9db456d4db936695d240b8fbc77c889f [diff] [blame] |
Fix refleak in chain().
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 @@ 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 */ }