Commit f1cca2b5 authored by Raymond Hettinger's avatar Raymond Hettinger

Fix refleak in chain().

parent a28df13a
......@@ -1682,8 +1682,8 @@ chain_next(chainobject *lz)
return NULL; /* no more input sources */
}
lz->active = PyObject_GetIter(iterable);
if (lz->active == NULL) {
Py_DECREF(iterable);
if (lz->active == NULL) {
Py_CLEAR(lz->source);
return NULL; /* input not iterable */
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment