[Python-checkins] GH-94644: fix test_curses ref leak (GH-94647)

miss-islington webhook-mailer at python.org
Thu Jul 7 07:41:30 EDT 2022


https://github.com/python/cpython/commit/c5819c1f6c67f04e08f058ac7f24dec86e0e4554
commit: c5819c1f6c67f04e08f058ac7f24dec86e0e4554
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-07-07T04:41:06-07:00
summary:

GH-94644: fix test_curses ref leak (GH-94647)

(cherry picked from commit 277f55cb04409ccdf651d43df5eb9dcb3ee3128c)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com>

files:
M Modules/_cursesmodule.c

diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index a1de43599c99d..e043f747310b6 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -378,6 +378,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;



More information about the Python-checkins mailing list