From 88418c33729804cc86a9492e3e30f1123f56ddcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 23 Feb 2022 22:04:05 +0100 Subject: [PATCH] Properly free up enqueued netievents in nm_destroy() When the isc_netmgr is being destroyed, the normal and priority queues should be dequeued and netievents properly freed. This wasn't the case. --- lib/isc/netmgr/netmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 4b4871de9c..0e6c37fd7d 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -372,14 +372,14 @@ nm_destroy(isc_nm_t **mgr0) { /* Empty the async event queues */ while ((ievent = DEQUEUE_PRIORITY_NETIEVENT(worker)) != NULL) { - isc_mem_put(mgr->mctx, ievent, sizeof(*ievent)); + isc__nm_put_netievent(mgr, ievent); } INSIST(DEQUEUE_PRIVILEGED_NETIEVENT(worker) == NULL); INSIST(DEQUEUE_TASK_NETIEVENT(worker) == NULL); - while ((ievent = DEQUEUE_PRIORITY_NETIEVENT(worker)) != NULL) { - isc_mem_put(mgr->mctx, ievent, sizeof(*ievent)); + while ((ievent = DEQUEUE_NORMAL_NETIEVENT(worker)) != NULL) { + isc__nm_put_netievent(mgr, ievent); } isc_condition_destroy(&worker->cond_prio); isc_mutex_destroy(&worker->lock);