Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-122234: Add DECREFs to error paths
  • Loading branch information
encukou committed Jul 29, 2024
commit a51d251ea18b6cc8dc41f2eb1e6480d23bb2e101
4 changes: 4 additions & 0 deletions Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
continue;
}
else {
Py_DECREF(item);
Py_DECREF(iter);
return NULL;
}
}
Expand Down Expand Up @@ -2745,6 +2747,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
continue;
}
else {
Py_DECREF(item);
Py_DECREF(iter);
return NULL;
}
}
Expand Down