summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 4b12048..8aa1ba0 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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);