summaryrefslogtreecommitdiffstats
path: root/Modules/itertoolsmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-03-04 22:29:44 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-03-04 22:29:44 (GMT)
commitf1cca2b59367c738a18617e4c4552f208ac8f5c2 (patch)
tree1259061f364e42ea7819debe4b5b66ba09a69a10 /Modules/itertoolsmodule.c
parenta28df13a9db456d4db936695d240b8fbc77c889f (diff)
downloadcpython-f1cca2b59367c738a18617e4c4552f208ac8f5c2.zip
cpython-f1cca2b59367c738a18617e4c4552f208ac8f5c2.tar.gz
cpython-f1cca2b59367c738a18617e4c4552f208ac8f5c2.tar.bz2
Fix refleak in chain().
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r--Modules/itertoolsmodule.c2
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 */
}