Skip to content

Commit

Permalink
[3.11] gh-116296: Fix refleak in reduce_newobj() corner case (GH-116297
Browse files Browse the repository at this point in the history
…) (#116300)

(cherry picked from commit 17c4849)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
  • Loading branch information
3 people committed Mar 4, 2024
1 parent 7dfde84 commit f068522
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
@@ -0,0 +1 @@
Fix possible refleak in :meth:`!object.__reduce__` internal error handling.
1 change: 1 addition & 0 deletions Objects/typeobject.c
Expand Up @@ -5327,6 +5327,7 @@ reduce_newobj(PyObject *obj)
}
else {
/* args == NULL */
Py_DECREF(copyreg);
Py_DECREF(kwargs);
PyErr_BadInternalCall();
return NULL;
Expand Down

0 comments on commit f068522

Please sign in to comment.