]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95369: add missing decref in error case of exception group's split (GH-95370)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 28 Jul 2022 11:28:46 +0000 (04:28 -0700)
committerGitHub <noreply@github.com>
Thu, 28 Jul 2022 11:28:46 +0000 (04:28 -0700)
(cherry picked from commit bceb197947bbaebb11e01195bdce4f240fdf9332)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Objects/exceptions.c

index c6af82a466855035df16470da2bce80beb4988ff..3c4df2facfe2e2a53015f4eec04414ddb0f5617c 100644 (file)
@@ -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);