We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a2d00c commit 0e950ddCopy full SHA for 0e950dd
Objects/enumobject.c
@@ -108,14 +108,18 @@ enum_next_long(enumobject *en, PyObject* next_item)
108
109
if (en->en_longindex == NULL) {
110
en->en_longindex = PyLong_FromSsize_t(PY_SSIZE_T_MAX);
111
- if (en->en_longindex == NULL)
+ if (en->en_longindex == NULL) {
112
+ Py_DECREF(next_item);
113
return NULL;
114
+ }
115
}
116
next_index = en->en_longindex;
117
assert(next_index != NULL);
118
stepped_up = PyNumber_Add(next_index, _PyLong_One);
- if (stepped_up == NULL)
119
+ if (stepped_up == NULL) {
120
121
122
123
en->en_longindex = stepped_up;
124
125
if (result->ob_refcnt == 1) {
0 commit comments