Skip to content

Commit e542d41

Browse files
authored
bpo-42866: Fix refleak in CJK getcodec() (GH-24165)
Fix a reference leak in the getcodec() function of CJK codecs.
1 parent 07f2cee commit e542d41

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a reference leak in the ``getcodec()`` function of CJK codecs. Patch by
2+
Victor Stinner.

Modules/cjkcodecs/cjkcodecs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ getcodec(PyObject *self, PyObject *encoding)
291291

292292
r = PyObject_CallOneArg(cofunc, codecobj);
293293
Py_DECREF(codecobj);
294+
Py_DECREF(cofunc);
294295

295296
return r;
296297
}

0 commit comments

Comments
 (0)