Skip to content

gh-123290: curses: fix reference leaks in error-branches and cleanup module's initialization #123910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
cosmetic changes
  • Loading branch information
picnixz committed Sep 10, 2024
commit ea3fd8da7a8b6066b7f9e2289c74d95c19e6923c
4 changes: 1 addition & 3 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3309,14 +3309,12 @@ static PyObject *
_curses_initscr_impl(PyObject *module)
/*[clinic end generated code: output=619fb68443810b7b input=514f4bce1821f6b5]*/
{
WINDOW *win;

if (CURSES_INITSCR_CALLED) {
wrefresh(stdscr);
return (PyObject *)PyCursesWindow_New(stdscr, NULL);
}

win = initscr();
WINDOW *win = initscr();

if (win == NULL) {
PyErr_SetString(PyCursesError, catchall_NULL);
Expand Down