Skip to content

Commit 712db4f

Browse files
kumaraditya303miss-islington
authored andcommitted
pythonGH-94644: fix test_curses ref leak (pythonGH-94647)
(cherry picked from commit 277f55c) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
1 parent c0b7868 commit 712db4f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎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)