summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 3dc6a00..6ad8d66 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1889,7 +1889,7 @@ builtin_sum(PyObject *self, PyObject *args)
return PyFloat_FromDouble(f_result);
}
if (PyFloat_CheckExact(item)) {
- PyFPE_START_PROTECT("add", return 0)
+ PyFPE_START_PROTECT("add", Py_DECREF(item); Py_DECREF(iter); return 0)
f_result += PyFloat_AS_DOUBLE(item);
PyFPE_END_PROTECT(f_result)
Py_DECREF(item);
@@ -1900,7 +1900,7 @@ builtin_sum(PyObject *self, PyObject *args)
int overflow;
value = PyLong_AsLongAndOverflow(item, &overflow);
if (!overflow) {
- PyFPE_START_PROTECT("add", return 0)
+ PyFPE_START_PROTECT("add", Py_DECREF(item); Py_DECREF(iter); return 0)
f_result += (double)value;
PyFPE_END_PROTECT(f_result)
Py_DECREF(item);