Fix refleak in chain().

This commit is contained in:
Raymond Hettinger 2008-03-04 22:29:44 +00:00
parent a28df13a9d
commit f1cca2b593

View file

@ -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 */
}