Use tor_event_free instead of event_del+tor_free
commit15e95c3bda1e3781a7f7175de4e65a749e9d6a2c
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>
Wed, 20 Apr 2022 02:50:31 +0000 (19 22:50 -0400)
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>
Wed, 20 Apr 2022 04:14:25 +0000 (20 00:14 -0400)
tree12b339464465d1dea2c2ee6c4542e3de17ba5991
parent616c06c0b2748db163cbb6882043d24fdbaaf335
Use tor_event_free instead of event_del+tor_free

Using tor_free is wrong; event_free must be called for objects obtained from
event_new. Additionally, this slightly simplifies the code.

Also, add a static_assert to prevent further instances.
src/core/mainloop/mainloop.c
src/lib/malloc/malloc.h
src/test/test_connection.c