From 34c50ceb1e2d40f7faab673d2033ecaafd3c611a Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 10 Feb 2023 06:00:58 +0300 Subject: [PATCH] gh-101747: Fix refleak in new `OrderedDict` repr (GH-101748) --- Objects/odictobject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/odictobject.c b/Objects/odictobject.c index ab2bbed3587..215a8af54fb 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);