summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-05-30 06:37:27 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-05-30 06:37:27 (GMT)
commit65856600ed74b59d6e3428f3fd24d39d60d40bbb (patch)
tree059a6858f45c96299dbd038ae03996ded410828d /Python/bltinmodule.c
parent8df4e22a2841e59fb4b7e14a846be980115605ba (diff)
downloadcpython-65856600ed74b59d6e3428f3fd24d39d60d40bbb.zip
cpython-65856600ed74b59d6e3428f3fd24d39d60d40bbb.tar.gz
cpython-65856600ed74b59d6e3428f3fd24d39d60d40bbb.tar.bz2
Issue 2784: fix leaks in exception exit.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index dbae0c9..715a108 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2305,14 +2305,14 @@ 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);
continue;
}
if (PyInt_CheckExact(item)) {
- PyFPE_START_PROTECT("add", return 0)
+ PyFPE_START_PROTECT("add", Py_DECREF(item); Py_DECREF(iter); return 0)
f_result += (double)PyInt_AS_LONG(item);
PyFPE_END_PROTECT(f_result)
Py_DECREF(item);