Skip to content

Commit 0049db8

Browse files
committed
Fix refcount leak in range_vectorcall.
1 parent 821af67 commit 0049db8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/rangeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ range_vectorcall(
151151
step = args[2];
152152
//Intentional fall through
153153
case 2:
154-
step = validate_step(step); /* Caution, this can clear exceptions */
155154
/* Convert borrowed refs to owned refs */
156155
start = PyNumber_Index(args[0]);
157156
if (!start)
@@ -161,6 +160,7 @@ range_vectorcall(
161160
Py_DECREF(start);
162161
return NULL;
163162
}
163+
step = validate_step(step); /* Caution, this can clear exceptions */
164164
if (!step) {
165165
Py_DECREF(start);
166166
Py_DECREF(stop);

0 commit comments

Comments
 (0)