Skip to content

Commit f4ba191

Browse files
committed
pythongh-111178: Fix _PyLegacyEventHandler_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 9a63138 commit f4ba191

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Python/legacy_tracing.c

-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ PyTypeObject _PyLegacyEventHandler_Type = {
382382
PyVarObject_HEAD_INIT(&PyType_Type, 0)
383383
"sys.legacy_event_handler",
384384
sizeof(_PyLegacyEventHandler),
385-
.tp_dealloc = (destructor)PyObject_Free,
386385
.tp_vectorcall_offset = offsetof(_PyLegacyEventHandler, vectorcall),
387386
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
388387
Py_TPFLAGS_HAVE_VECTORCALL | Py_TPFLAGS_DISALLOW_INSTANTIATION,

0 commit comments

Comments
 (0)