Skip to content

Commit f068522

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

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5327,6 +5327,7 @@ reduce_newobj(PyObject *obj)
53275327
}
53285328
else {
53295329
/* args == NULL */
5330+
Py_DECREF(copyreg);
53305331
Py_DECREF(kwargs);
53315332
PyErr_BadInternalCall();
53325333
return NULL;

0 commit comments

Comments
 (0)