aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-01-08 15:01:38 +0100
committerGitHub <noreply@github.com>2021-01-08 15:01:38 +0100
commite542d417b96077d04aec089505eacb990c9799ae (patch)
treeef81dfd04b71bd7f8772f8cee4f0b2d7e900d158 /Modules/cjkcodecs
parentbpo-42846: Convert CJK codec extensions to multiphase init (GH-24157) (diff)
downloadcpython-e542d417b96077d04aec089505eacb990c9799ae.tar.gz
cpython-e542d417b96077d04aec089505eacb990c9799ae.tar.bz2
cpython-e542d417b96077d04aec089505eacb990c9799ae.zip
bpo-42866: Fix refleak in CJK getcodec() (GH-24165)
Fix a reference leak in the getcodec() function of CJK codecs.
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index 3b89bc93ed1..ba8fad26055 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -291,6 +291,7 @@ getcodec(PyObject *self, PyObject *encoding)
r = PyObject_CallOneArg(cofunc, codecobj);
Py_DECREF(codecobj);
+ Py_DECREF(cofunc);
return r;
}