diff options
author | Raymond Hettinger <python@rcn.com> | 2008-03-04 22:29:44 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-03-04 22:29:44 (GMT) |
commit | f1cca2b59367c738a18617e4c4552f208ac8f5c2 (patch) | |
tree | 1259061f364e42ea7819debe4b5b66ba09a69a10 | |
parent | a28df13a9db456d4db936695d240b8fbc77c889f (diff) | |
download | cpython-f1cca2b59367c738a18617e4c4552f208ac8f5c2.zip cpython-f1cca2b59367c738a18617e4c4552f208ac8f5c2.tar.gz cpython-f1cca2b59367c738a18617e4c4552f208ac8f5c2.tar.bz2 |
Fix refleak in chain().
-rw-r--r-- | Modules/itertoolsmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 */ } |