Fix leak of canceled events

This commit is contained in:
dmiller 2026-04-06 21:33:44 +00:00
parent 61f7a8d3ca
commit c693c60a54

View file

@ -1252,6 +1252,8 @@ void nsock_pool_add_event(struct npool *nsp, struct nevent *nse) {
assert(nse->type >= 0 && nse->type < NSE_TYPE_MAX);
event_dispatch_and_delete(nsp, nse, 1);
// No need to call nevent_unref since we never added it to any lists!
// However, we do need to keep ownership of the event object.
gh_list_append(&nsp->free_events, &nse->nodeq_io);
return;
}