aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/_xxsubinterpretersmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-23 14:57:50 +0100
committerGitHub <noreply@github.com>2022-11-23 14:57:50 +0100
commit81f7359f67a7166d57a10a3d5366406d9c85f1de (patch)
treef72a35747fa77ab9c63ba70ef9e1620daddf0cc3 /Modules/_xxsubinterpretersmodule.c
parent5d9183c7ad68eb9ddb53d54a3f9a27e29dbabf31 (diff)
downloadcpython-81f7359f67a7166d57a10a3d5366406d9c85f1de.tar.gz
cpython-81f7359f67a7166d57a10a3d5366406d9c85f1de.zip
gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)
Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
Diffstat (limited to 'Modules/_xxsubinterpretersmodule.c')
-rw-r--r--Modules/_xxsubinterpretersmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 244ae3517e1..2c9e0cda1ab 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -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);