https://github.com/python/cpython/commit/f068522a3a6091745df138bc9c9a7f7785bc6315 commit: f068522a3a6091745df138bc9c9a7f7785bc6315 branch: 3.11 author: Miss Islington (bot) <[email protected]> committer: erlend-aasland <[email protected]> date: 2024-03-04T10:04:21Z summary:
[3.11] gh-116296: Fix refleak in reduce_newobj() corner case (GH-116297) (#116300) (cherry picked from commit 17c4849981905fb1c9bfbb2b963b6ee12e3efb2c) Co-authored-by: Erlend E. Aasland <[email protected]> Co-authored-by: Brandt Bucher <[email protected]> files: A Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst M Objects/typeobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst b/Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst new file mode 100644 index 00000000000000..0781e9282205d1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2024-03-04-10-19-51.gh-issue-116296.gvtxyU.rst @@ -0,0 +1 @@ +Fix possible refleak in :meth:`!object.__reduce__` internal error handling. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 8c2e725cac9d2e..9dfad5fa4389fa 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5327,6 +5327,7 @@ reduce_newobj(PyObject *obj) } else { /* args == NULL */ + Py_DECREF(copyreg); Py_DECREF(kwargs); PyErr_BadInternalCall(); return NULL; _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
