diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-23 13:57:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-23 13:57:50 (GMT) |
commit | 81f7359f67a7166d57a10a3d5366406d9c85f1de (patch) | |
tree | f72a35747fa77ab9c63ba70ef9e1620daddf0cc3 /Modules/cjkcodecs | |
parent | 5d9183c7ad68eb9ddb53d54a3f9a27e29dbabf31 (diff) | |
download | cpython-81f7359f67a7166d57a10a3d5366406d9c85f1de.zip cpython-81f7359f67a7166d57a10a3d5366406d9c85f1de.tar.gz cpython-81f7359f67a7166d57a10a3d5366406d9c85f1de.tar.bz2 |
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/cjkcodecs')
-rw-r--r-- | Modules/cjkcodecs/multibytecodec.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 8b62326..1d77fd3 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -1463,8 +1463,7 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self, goto errorexit; } - Py_DECREF(cres); - cres = NULL; + Py_SETREF(cres, NULL); if (sizehint < 0 || buf.writer.pos != 0 || rsize == 0) break; |