]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95369: add missing decref in error case of exception group's split (GH-95370)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 28 Jul 2022 10:38:46 +0000 (11:38 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Jul 2022 10:38:46 +0000 (11:38 +0100)
Objects/exceptions.c

index 745b89078ffe199b5ef9319cc5b1d6d3e0df4575..c56886870d3c8d948328da67e17a2c4bfd3b5e3d 100644 (file)
@@ -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);