]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-94644: fix test_curses ref leak (GH-94647)
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Thu, 7 Jul 2022 10:57:45 +0000 (16:27 +0530)
committerGitHub <noreply@github.com>
Thu, 7 Jul 2022 10:57:45 +0000 (03:57 -0700)
Modules/_cursesmodule.c

index 7e2699e1b5c5bbeb6cfb5e14fc358d1bf83925c0..c10b2b302c6024b982192ae6ea73a5a93befb738 100644 (file)
@@ -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;