Skip to content

Commit 77a0153

Browse files
GH-94644: fix test_curses ref leak (GH-94647)
(cherry picked from commit 277f55c) Co-authored-by: Kumar Aditya <[email protected]>
1 parent 65c4316 commit 77a0153

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_cursesmodule.c

Lines changed: 1 addition & 0 deletions
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)