[3.12] gh-116296: Fix refleak in reduce_newobj() corner case (GH-116297) (#116299)

(cherry picked from commit 17c4849981)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
This commit is contained in:
Miss Islington (bot) 2024-03-04 11:04:44 +01:00 committed by GitHub
parent 722b9cf9fb
commit d8a56ea439
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -6258,6 +6258,7 @@ reduce_newobj(PyObject *obj)
}
else {
/* args == NULL */
Py_DECREF(copyreg);
Py_DECREF(kwargs);
PyErr_BadInternalCall();
return NULL;