]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32604: Fix reference leak in select module (GH-20600)
authorVictor Stinner <vstinner@python.org>
Wed, 3 Jun 2020 12:36:46 +0000 (14:36 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 12:36:46 +0000 (14:36 +0200)
Fix reference leak in PyInit_select() of the select module:
remove Py_INCREF(poll_Type).

Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst [new file with mode: 0644]
Modules/selectmodule.c

diff --git a/Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst b/Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst
new file mode 100644 (file)
index 0000000..6375276
--- /dev/null
@@ -0,0 +1,2 @@
+Fix reference leak in the :mod:`select` module when the the module is
+imported in a subinterpreter.
index 04e0067eec21830a16f0dc044adba8a35a6f4723..adf014fac43d4b61c58bd2fc341701874614928b 100644 (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