[Python-checkins] bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)

Miss Islington (bot) webhook-mailer at python.org
Sat Nov 16 19:14:52 EST 2019


https://github.com/python/cpython/commit/8a334af13368573cc645488481b1173d65eeeb9a
commit: 8a334af13368573cc645488481b1173d65eeeb9a
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-11-16T16:14:45-08:00
summary:

bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)


https://bugs.python.org/issue38823
(cherry picked from commit 143a97f64128070386b12a0ee589bdaad5e51f40)

Co-authored-by: Brandt Bucher <brandtbucher at gmail.com>

files:
M Modules/_contextvarsmodule.c

diff --git a/Modules/_contextvarsmodule.c b/Modules/_contextvarsmodule.c
index 71dd7fd8d08d4..1abcdbfa921c2 100644
--- a/Modules/_contextvarsmodule.c
+++ b/Modules/_contextvarsmodule.c
@@ -52,6 +52,7 @@ PyInit__contextvars(void)
                            (PyObject *)&PyContext_Type) < 0)
     {
         Py_DECREF(&PyContext_Type);
+        Py_DECREF(m);
         return NULL;
     }
 
@@ -60,6 +61,7 @@ PyInit__contextvars(void)
                            (PyObject *)&PyContextVar_Type) < 0)
     {
         Py_DECREF(&PyContextVar_Type);
+        Py_DECREF(m);
         return NULL;
     }
 
@@ -68,6 +70,7 @@ PyInit__contextvars(void)
                            (PyObject *)&PyContextToken_Type) < 0)
     {
         Py_DECREF(&PyContextToken_Type);
+        Py_DECREF(m);
         return NULL;
     }
 



More information about the Python-checkins mailing list