summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-07 12:03:00 (GMT)
committerGitHub <noreply@github.com>2022-07-07 12:03:00 (GMT)
commit77a015387bb5dce0ecce10b9589e58048d9963a1 (patch)
tree615d1fcad06a5379e5ccf10f692b067b6226bd71
parent65c431685b40583b877da573e41514d63217815d (diff)
downloadcpython-77a015387bb5dce0ecce10b9589e58048d9963a1.zip
cpython-77a015387bb5dce0ecce10b9589e58048d9963a1.tar.gz
cpython-77a015387bb5dce0ecce10b9589e58048d9963a1.tar.bz2
GH-94644: fix test_curses ref leak (GH-94647)
(cherry picked from commit 277f55cb04409ccdf651d43df5eb9dcb3ee3128c) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
-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;