mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in builtin_sum_impl() (GH-8872)
Reported by Svace static analyzer.
This commit is contained in:
parent
f6247aac08
commit
2b824b2538
1 changed files with 5 additions and 0 deletions
|
@ -2401,6 +2401,11 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
|
|||
}
|
||||
}
|
||||
result = PyFloat_FromDouble(f_result);
|
||||
if (result == NULL) {
|
||||
Py_DECREF(item);
|
||||
Py_DECREF(iter);
|
||||
return NULL;
|
||||
}
|
||||
temp = PyNumber_Add(result, item);
|
||||
Py_DECREF(result);
|
||||
Py_DECREF(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue