Skip to content

Commit c5819c1

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 dc36801 commit c5819c1

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
@@ -378,6 +378,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj,
378378
return 0;
379379
/* check for embedded null bytes */
380380
if (PyBytes_AsStringAndSize(*bytes, &str, NULL) < 0) {
381+
Py_CLEAR(*bytes);
381382
return 0;
382383
}
383384
return 1;

0 commit comments

Comments
 (0)