Skip to content

Commit 277f55c

Browse files
pythonGH-94644: fix test_curses ref leak (pythonGH-94647)
1 parent 9c60b25 commit 277f55c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_cursesmodule.c

+1
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj,
383383
return 0;
384384
/* check for embedded null bytes */
385385
if (PyBytes_AsStringAndSize(*bytes, &str, NULL) < 0) {
386+
Py_CLEAR(*bytes);
386387
return 0;
387388
}
388389
return 1;

0 commit comments

Comments
 (0)