forked from mirrors/kore
don't leak op in error path
This commit is contained in:
parent
1c30da855c
commit
bb00deca2c
|
@ -1029,10 +1029,13 @@ python_kore_gather(PyObject *self, PyObject *args)
|
|||
TAILQ_INIT(&op->coroutines);
|
||||
|
||||
for (idx = 0; idx < sz; idx++) {
|
||||
if ((obj = PyTuple_GetItem(args, idx)) == NULL)
|
||||
if ((obj = PyTuple_GetItem(args, idx)) == NULL) {
|
||||
Py_DECREF((PyObject *)op);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (!PyCoro_CheckExact(obj)) {
|
||||
Py_DECREF((PyObject *)op);
|
||||
PyErr_SetString(PyExc_TypeError, "not a coroutine");
|
||||
return (NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue