Skip to content

Commit 1fe79a4

Browse files
bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)
https://bugs.python.org/issue38823 (cherry picked from commit 143a97f) Co-authored-by: Brandt Bucher <[email protected]>
1 parent 48f4f75 commit 1fe79a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_contextvarsmodule.c

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ PyInit__contextvars(void)
5252
(PyObject *)&PyContext_Type) < 0)
5353
{
5454
Py_DECREF(&PyContext_Type);
55+
Py_DECREF(m);
5556
return NULL;
5657
}
5758

@@ -60,6 +61,7 @@ PyInit__contextvars(void)
6061
(PyObject *)&PyContextVar_Type) < 0)
6162
{
6263
Py_DECREF(&PyContextVar_Type);
64+
Py_DECREF(m);
6365
return NULL;
6466
}
6567

@@ -68,6 +70,7 @@ PyInit__contextvars(void)
6870
(PyObject *)&PyContextToken_Type) < 0)
6971
{
7072
Py_DECREF(&PyContextToken_Type);
73+
Py_DECREF(m);
7174
return NULL;
7275
}
7376

0 commit comments

Comments
 (0)