bpo-32604: Fix reference leak in select module (GH-20600)

Fix reference leak in PyInit_select() of the select module:
remove Py_INCREF(poll_Type).
This commit is contained in:
Victor Stinner 2020-06-03 14:36:46 +02:00 committed by GitHub
parent 317bab0bf6
commit 18a90248fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -0,0 +1,2 @@
Fix reference leak in the :mod:`select` module when the the module is
imported in a subinterpreter.

View File

@ -2482,7 +2482,6 @@ PyInit_select(void)
if (poll_Type == NULL)
return NULL;
get_select_state(m)->poll_Type = (PyTypeObject *)poll_Type;
Py_INCREF(poll_Type);
PyModule_AddIntMacro(m, POLLIN);
PyModule_AddIntMacro(m, POLLPRI);
@ -2518,7 +2517,6 @@ PyInit_select(void)
if (devpoll_Type == NULL)
return NULL;
get_select_state(m)->devpoll_Type = (PyTypeObject *)devpoll_Type;
Py_INCREF(devpoll_Type);
#endif
#ifdef HAVE_EPOLL