Skip to content

Commit ffe1b57

Browse files
committed
pythongh-111178: Fix PyRangeIter_Type deallocator
Don't use PyObject_Free() as tp_dealloc to avoid an undefined behavior. Instead, use the default deallocator which just calls tp_free which is PyObject_Free().
1 parent 061da44 commit ffe1b57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/rangeobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ PyTypeObject PyRangeIter_Type = {
910910
sizeof(_PyRangeIterObject), /* tp_basicsize */
911911
0, /* tp_itemsize */
912912
/* methods */
913-
(destructor)PyObject_Free, /* tp_dealloc */
913+
0, /* tp_dealloc */
914914
0, /* tp_vectorcall_offset */
915915
0, /* tp_getattr */
916916
0, /* tp_setattr */

0 commit comments

Comments
 (0)