Skip to content

Commit

Permalink
bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)
Browse files Browse the repository at this point in the history
https://bugs.python.org/issue38823
(cherry picked from commit 143a97f)

Co-authored-by: Brandt Bucher <[email protected]>
  • Loading branch information
miss-islington and brandtbucher authored Nov 17, 2019
1 parent 825e91b commit 8a334af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Modules/_contextvarsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ PyInit__contextvars(void)
(PyObject *)&PyContext_Type) < 0)
{
Py_DECREF(&PyContext_Type);
Py_DECREF(m);
return NULL;
}

Expand All @@ -60,6 +61,7 @@ PyInit__contextvars(void)
(PyObject *)&PyContextVar_Type) < 0)
{
Py_DECREF(&PyContextVar_Type);
Py_DECREF(m);
return NULL;
}

Expand All @@ -68,6 +70,7 @@ PyInit__contextvars(void)
(PyObject *)&PyContextToken_Type) < 0)
{
Py_DECREF(&PyContextToken_Type);
Py_DECREF(m);
return NULL;
}

Expand Down

0 comments on commit 8a334af

Please sign in to comment.