mirror of
https://github.com/python/cpython.git
synced 2026-01-30 06:36:55 +00:00
[3.12] gh-116296: Fix refleak in reduce_newobj() corner case (GH-116297) (#116299)
(cherry picked from commit 17c4849981905fb1c9bfbb2b963b6ee12e3efb2c) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
This commit is contained in:
parent
722b9cf9fb
commit
d8a56ea439
@ -0,0 +1 @@
|
||||
Fix possible refleak in :meth:`!object.__reduce__` internal error handling.
|
||||
@ -6258,6 +6258,7 @@ reduce_newobj(PyObject *obj)
|
||||
}
|
||||
else {
|
||||
/* args == NULL */
|
||||
Py_DECREF(copyreg);
|
||||
Py_DECREF(kwargs);
|
||||
PyErr_BadInternalCall();
|
||||
return NULL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user