mirror of https://github.com/python/cpython
gh-116296: Fix refleak in reduce_newobj() corner case (#116297)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
This commit is contained in:
parent
1dce0073da
commit
17c4849981
|
@ -0,0 +1 @@
|
||||||
|
Fix possible refleak in :meth:`!object.__reduce__` internal error handling.
|
|
@ -6549,6 +6549,7 @@ reduce_newobj(PyObject *obj)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* args == NULL */
|
/* args == NULL */
|
||||||
|
Py_DECREF(copyreg);
|
||||||
Py_DECREF(kwargs);
|
Py_DECREF(kwargs);
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue