gh-95369: add missing decref in error case of exception group's split (GH-95370)

This commit is contained in:
Irit Katriel 2022-07-28 11:38:46 +01:00 committed by GitHub
parent b946f529ef
commit bceb197947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View 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);