From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Thu, 28 Jul 2022 10:38:46 +0000 (+0100) Subject: gh-95369: add missing decref in error case of exception group's split (GH-95370) X-Git-Tag: v3.12.0a1~808 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bceb197947bbaebb11e01195bdce4f240fdf9332;p=thirdparty%2FPython%2Fcpython.git gh-95369: add missing decref in error case of exception group's split (GH-95370) --- diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 745b89078ffe..c56886870d3c 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -1106,6 +1106,7 @@ exceptiongroup_split_recursive(PyObject *exc, assert(PyList_CheckExact(match_list)); if (PyList_Append(match_list, rec_result.match) < 0) { Py_DECREF(rec_result.match); + Py_XDECREF(rec_result.rest); goto done; } Py_DECREF(rec_result.match);