From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:28:46 +0000 (-0700) Subject: gh-95369: add missing decref in error case of exception group's split (GH-95370) X-Git-Tag: v3.11.0rc1~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6934726d222222e2429b763396b266674d906e98;p=thirdparty%2FPython%2Fcpython.git gh-95369: add missing decref in error case of exception group's split (GH-95370) (cherry picked from commit bceb197947bbaebb11e01195bdce4f240fdf9332) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- diff --git a/Objects/exceptions.c b/Objects/exceptions.c index c6af82a46685..3c4df2facfe2 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -1114,6 +1114,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);