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

https://bugs.python.org/issue38823
This commit is contained in:
Brandt Bucher 2019-11-16 15:57:32 -08:00 committed by Miss Islington (bot)
parent c3f6bdc332
commit 143a97f641
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}