Kaydet (Commit) 2b824b25 authored tarafından Alexey Izbyshev's avatar Alexey Izbyshev Kaydeden (comit) Benjamin Peterson

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

Reported by Svace static analyzer.
üst f6247aac
......@@ -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);
......
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