]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101747: Fix refleak in new `OrderedDict` repr (GH-101748)
authorNikita Sobolev <mail@sobolevn.me>
Fri, 10 Feb 2023 03:00:58 +0000 (06:00 +0300)
committerGitHub <noreply@github.com>
Fri, 10 Feb 2023 03:00:58 +0000 (21:00 -0600)
Objects/odictobject.c

index ab2bbed35873de65f8ccf125cde8dc2a1673f6a5..215a8af54fb266bc0e79c958d0350b8b46911f32 100644 (file)
@@ -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);