summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2025-03-14 09:23:54 (GMT)
committerGitHub <noreply@github.com>2025-03-14 09:23:54 (GMT)
commit0ddfb5717f761fcab7929957eca65044116a96a4 (patch)
treed5219aa5a183c30f05503116b939e903a7f18dca /Python
parent96492785b202a92af1b71f8c011ea839ca3ebb07 (diff)
downloadcpython-0ddfb5717f761fcab7929957eca65044116a96a4.zip
cpython-0ddfb5717f761fcab7929957eca65044116a96a4.tar.gz
cpython-0ddfb5717f761fcab7929957eca65044116a96a4.tar.bz2
gh-111178: Fix _PyLegacyEventHandler_Type deallocator (#131193)
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().
Diffstat (limited to 'Python')
-rw-r--r--Python/legacy_tracing.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Python/legacy_tracing.c b/Python/legacy_tracing.c
index 82465c6..124b219 100644
--- a/Python/legacy_tracing.c
+++ b/Python/legacy_tracing.c
@@ -382,7 +382,6 @@ PyTypeObject _PyLegacyEventHandler_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"sys.legacy_event_handler",
sizeof(_PyLegacyEventHandler),
- .tp_dealloc = (destructor)PyObject_Free,
.tp_vectorcall_offset = offsetof(_PyLegacyEventHandler, vectorcall),
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
Py_TPFLAGS_HAVE_VECTORCALL | Py_TPFLAGS_DISALLOW_INSTANTIATION,