mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)
Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
This commit is contained in:
parent
5d9183c7ad
commit
81f7359f67
22 changed files with 44 additions and 87 deletions
|
@ -2320,8 +2320,7 @@ channel_list_all(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
PyObject *id = (PyObject *)newchannelid(&ChannelIDtype, *cur, 0,
|
||||
&_globals.channels, 0, 0);
|
||||
if (id == NULL) {
|
||||
Py_DECREF(ids);
|
||||
ids = NULL;
|
||||
Py_SETREF(ids, NULL);
|
||||
break;
|
||||
}
|
||||
PyList_SET_ITEM(ids, (Py_ssize_t)i, id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue