gh-122234: Add DECREFs to error paths (#122406)

Co-Authored-By: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
Petr Viktorin 2024-07-29 18:10:25 +02:00 committed by GitHub
parent 9187484dd9
commit 89fa05fdce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -2694,6 +2694,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
continue;
}
else {
Py_DECREF(item);
Py_DECREF(iter);
return NULL;
}
}
@ -2745,6 +2747,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
continue;
}
else {
Py_DECREF(item);
Py_DECREF(iter);
return NULL;
}
}