summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-28 11:28:46 (GMT)
committerGitHub <noreply@github.com>2022-07-28 11:28:46 (GMT)
commit6934726d222222e2429b763396b266674d906e98 (patch)
treed8d778f8bbd60f01f3511e67f1a8ee6fd9f5f164
parent763801aae2eca326e7828fcd274acde6165a4a4b (diff)
downloadcpython-6934726d222222e2429b763396b266674d906e98.zip
cpython-6934726d222222e2429b763396b266674d906e98.tar.gz
cpython-6934726d222222e2429b763396b266674d906e98.tar.bz2
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>
-rw-r--r--Objects/exceptions.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index c6af82a..3c4df2f 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);