Skip to content

Commit

Permalink
pythongh-116296: Fix refleak in reduce_newobj() corner case (python#1…
Browse files Browse the repository at this point in the history
…16297)

Co-authored-by: Brandt Bucher <[email protected]>
  • Loading branch information
2 people authored and woodruffw committed Mar 4, 2024
1 parent 61a9e88 commit fdd22c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix possible refleak in :meth:`!object.__reduce__` internal error handling.
1 change: 1 addition & 0 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6549,6 +6549,7 @@ reduce_newobj(PyObject *obj)
}
else {
/* args == NULL */
Py_DECREF(copyreg);
Py_DECREF(kwargs);
PyErr_BadInternalCall();
return NULL;
Expand Down

0 comments on commit fdd22c5

Please sign in to comment.