summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-02-10 03:00:58 (GMT)
committerGitHub <noreply@github.com>2023-02-10 03:00:58 (GMT)
commit34c50ceb1e2d40f7faab673d2033ecaafd3c611a (patch)
tree891fd0001e5460c05281398ba09b1d3020ef531b /Objects
parent5b946d371979a772120e6ee7d37f9b735769d433 (diff)
downloadcpython-34c50ceb1e2d40f7faab673d2033ecaafd3c611a.zip
cpython-34c50ceb1e2d40f7faab673d2033ecaafd3c611a.tar.gz
cpython-34c50ceb1e2d40f7faab673d2033ecaafd3c611a.tar.bz2
gh-101747: Fix refleak in new `OrderedDict` repr (GH-101748)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/odictobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index ab2bbed..215a8af 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1385,6 +1385,7 @@ odict_repr(PyODictObject *self)
result = PyUnicode_FromFormat("%s(%R)",
_PyType_Name(Py_TYPE(self)),
dcopy);
+ Py_DECREF(dcopy);
Done:
Py_ReprLeave((PyObject *)self);