bpo-42866: Fix refleak in CJK getcodec() (GH-24165)

Fix a reference leak in the getcodec() function of CJK codecs.
This commit is contained in:
Victor Stinner 2021-01-08 15:01:38 +01:00 committed by GitHub
parent 07f2cee93f
commit e542d417b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Fix a reference leak in the ``getcodec()`` function of CJK codecs. Patch by
Victor Stinner.

View File

@ -291,6 +291,7 @@ getcodec(PyObject *self, PyObject *encoding)
r = PyObject_CallOneArg(cofunc, codecobj);
Py_DECREF(codecobj);
Py_DECREF(cofunc);
return r;
}