Skip to content

Commit 17c4849

Browse files
gh-116296: Fix refleak in reduce_newobj() corner case (#116297)
Co-authored-by: Brandt Bucher <[email protected]>
1 parent 1dce007 commit 17c4849

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
@@ -6549,6 +6549,7 @@ reduce_newobj(PyObject *obj)
65496549
}
65506550
else {
65516551
/* args == NULL */
6552+
Py_DECREF(copyreg);
65526553
Py_DECREF(kwargs);
65536554
PyErr_BadInternalCall();
65546555
return NULL;

0 commit comments

Comments
 (0)