]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Properly free up enqueued netievents in nm_destroy()
authorOndřej Surý <ondrej@isc.org>
Wed, 23 Feb 2022 21:04:05 +0000 (22:04 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 23 Feb 2022 21:53:41 +0000 (22:53 +0100)
When the isc_netmgr is being destroyed, the normal and priority queues
should be dequeued and netievents properly freed.  This wasn't the case.

(cherry picked from commit 88418c33729804cc86a9492e3e30f1123f56ddcd)

lib/isc/netmgr/netmgr.c

index fb9d77d3b494869a2dfdf4bf5606e885270ef0c5..4bd45e7235ce63b008386383b6dcb263a80bcb74 100644 (file)
@@ -403,14 +403,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);