mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199)
This commit is contained in:
parent
81636d3bbd
commit
5c814c83cd
3 changed files with 21 additions and 0 deletions
|
@ -3599,6 +3599,13 @@ _asyncio_all_tasks_impl(PyObject *module, PyObject *loop)
|
|||
Py_DECREF(item);
|
||||
}
|
||||
Py_DECREF(eager_iter);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
Py_DECREF(tasks);
|
||||
Py_DECREF(loop);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int err = 0;
|
||||
ASYNCIO_STATE_LOCK(state);
|
||||
struct llist_node *node;
|
||||
|
@ -3636,6 +3643,12 @@ _asyncio_all_tasks_impl(PyObject *module, PyObject *loop)
|
|||
}
|
||||
Py_DECREF(scheduled_iter);
|
||||
Py_DECREF(loop);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
Py_DECREF(tasks);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return tasks;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,6 +264,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other)
|
|||
|
||||
Py_DECREF(iter);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,10 @@ namespace_repr(PyObject *ns)
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
separator = PyUnicode_FromString(", ");
|
||||
if (separator == NULL)
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue