Skip to content

Commit

Permalink
pythongh-122234: Add DECREFs to error paths (python#122406)
Browse files Browse the repository at this point in the history
Co-Authored-By: Kirill Podoprigora <[email protected]>
  • Loading branch information
encukou and Eclips4 authored Jul 29, 2024
1 parent 9187484 commit 89fa05f
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 89fa05f

Please sign in to comment.