Commit 45ee4527 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

closes bpo-34474: Python/bltinmodule.c: Add missing NULL check in builtin_sum_impl() (GH-8872)


Reported by Svace static analyzer.
(cherry picked from commit 2b824b25)
Co-authored-by: default avatarAlexey Izbyshev <izbyshev@ispras.ru>
parent ea212066
......@@ -2401,6 +2401,11 @@ builtin_sum(PyObject *self, PyObject *args)
continue;
}
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment