gh-111178: Fix PyRangeIter_Type deallocator (#131162)

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().
This commit is contained in:
Victor Stinner 2025-03-13 10:46:20 +01:00 committed by GitHub
parent 36978f7ef3
commit 0c6c52f496
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -910,7 +910,7 @@ PyTypeObject PyRangeIter_Type = {
sizeof(_PyRangeIterObject), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
(destructor)PyObject_Free, /* tp_dealloc */
0, /* tp_dealloc */
0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */