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

This commit is contained in:
Kumar Aditya 2022-07-07 16:27:45 +05:30 committed by GitHub
parent 9c60b25a0d
commit 277f55cb04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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;