summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst1
-rw-r--r--Objects/typeobject.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst b/Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst
new file mode 100644
index 0000000..0781e92
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst
@@ -0,0 +1 @@
+Fix possible refleak in :meth:`!object.__reduce__` internal error handling.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 71d2068..7776ae2 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6258,6 +6258,7 @@ reduce_newobj(PyObject *obj)
}
else {
/* args == NULL */
+ Py_DECREF(copyreg);
Py_DECREF(kwargs);
PyErr_BadInternalCall();
return NULL;