Skip to content

Commit d8a56ea

Browse files
miss-islingtonerlend-aaslandbrandtbucher
authored
[3.12] gh-116296: Fix refleak in reduce_newobj() corner case (GH-116297) (#116299)
(cherry picked from commit 17c4849) Co-authored-by: Erlend E. Aasland <[email protected]> Co-authored-by: Brandt Bucher <[email protected]>
1 parent 722b9cf commit d8a56ea

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix possible refleak in :meth:`!object.__reduce__` internal error handling.

Objects/typeobject.c

+1
Original file line numberDiff line numberDiff line change
@@ -6258,6 +6258,7 @@ reduce_newobj(PyObject *obj)
62586258
}
62596259
else {
62606260
/* args == NULL */
6261+
Py_DECREF(copyreg);
62616262
Py_DECREF(kwargs);
62626263
PyErr_BadInternalCall();
62636264
return NULL;

0 commit comments

Comments
 (0)