summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-07-07 10:57:45 (GMT)
committerGitHub <noreply@github.com>2022-07-07 10:57:45 (GMT)
commit277f55cb04409ccdf651d43df5eb9dcb3ee3128c (patch)
tree4ab5f710bbc8479ddc963888158f8c62248d2484
parent9c60b25a0d5c0107862a04e3ba8f789921b88961 (diff)
downloadcpython-277f55cb04409ccdf651d43df5eb9dcb3ee3128c.zip
cpython-277f55cb04409ccdf651d43df5eb9dcb3ee3128c.tar.gz
cpython-277f55cb04409ccdf651d43df5eb9dcb3ee3128c.tar.bz2
GH-94644: fix test_curses ref leak (GH-94647)
-rw-r--r--Modules/_cursesmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 7e2699e..c10b2b3 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -383,6 +383,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj,
return 0;
/* check for embedded null bytes */
if (PyBytes_AsStringAndSize(*bytes, &str, NULL) < 0) {
+ Py_CLEAR(*bytes);
return 0;
}
return 1;