From 8a334af13368573cc645488481b1173d65eeeb9a Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sat, 16 Nov 2019 16:14:45 -0800 Subject: [PATCH] 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 --- Modules/_contextvarsmodule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/_contextvarsmodule.c b/Modules/_contextvarsmodule.c index 71dd7fd8d08..1abcdbfa921 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; }