mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
Missing DECREFs
This commit is contained in:
parent
1a94ec2664
commit
a45c4873fc
1 changed files with 2 additions and 0 deletions
|
@ -2121,12 +2121,14 @@ builtin_sum(PyObject *self, PyObject *args)
|
|||
PyFPE_START_PROTECT("add", 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)
|
||||
f_result += (double)PyInt_AS_LONG(item);
|
||||
PyFPE_END_PROTECT(f_result)
|
||||
Py_DECREF(item);
|
||||
continue;
|
||||
}
|
||||
result = PyFloat_FromDouble(f_result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue