File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -87,19 +87,25 @@ enum_next_long(enumobject *en, PyObject* next_item)
8787
8888 if (en -> en_longindex == NULL ) {
8989 en -> en_longindex = PyLong_FromSsize_t (PY_SSIZE_T_MAX );
90- if (en -> en_longindex == NULL )
90+ if (en -> en_longindex == NULL ) {
91+ Py_DECREF (next_item );
9192 return NULL ;
93+ }
9294 }
9395 if (one == NULL ) {
9496 one = PyLong_FromLong (1 );
95- if (one == NULL )
97+ if (one == NULL ) {
98+ Py_DECREF (next_item );
9699 return NULL ;
100+ }
97101 }
98102 next_index = en -> en_longindex ;
99103 assert (next_index != NULL );
100104 stepped_up = PyNumber_Add (next_index , one );
101- if (stepped_up == NULL )
105+ if (stepped_up == NULL ) {
106+ Py_DECREF (next_item );
102107 return NULL ;
108+ }
103109 en -> en_longindex = stepped_up ;
104110
105111 if (result -> ob_refcnt == 1 ) {
You can’t perform that action at this time.
0 commit comments