]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that the worker mem report with alloc stats does not attempt
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 1 Aug 2024 15:15:07 +0000 (17:15 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 1 Aug 2024 15:15:07 +0000 (17:15 +0200)
  to print memory use of forwards and hints if they have been
  deleted already.

daemon/worker.c
doc/Changelog

index b35fe65a3a646e26f7d41a66895074a27588f7a4..dd14a5a3cd5c5b86ae205166163e31ba99553746 100644 (file)
@@ -160,9 +160,11 @@ worker_mem_report(struct worker* ATTR_UNUSED(worker),
                + sizeof(worker->rndstate)
                + regional_get_mem(worker->scratchpad)
                + sizeof(*worker->env.scratch_buffer)
-               + sldns_buffer_capacity(worker->env.scratch_buffer)
-               + forwards_get_mem(worker->env.fwds)
-               + hints_get_mem(worker->env.hints);
+               + sldns_buffer_capacity(worker->env.scratch_buffer);
+       if(worker->daemon->env->fwds)
+               me += forwards_get_mem(worker->env.fwds);
+       if(worker->daemon->env->hints)
+               me += hints_get_mem(worker->env.hints);
        if(worker->thread_num == 0)
                me += acl_list_get_mem(worker->daemon->acl);
        if(cur_serv) {
index 7e1b81eb4ddf99a9edf0971122b266538c15e96e..f94ed7fec6e26b2dc12dfaaf25fda2b1d072b6df 100644 (file)
@@ -4,6 +4,9 @@
          to free the tail, specifically in the free of the list since that
          picked up the next item in the list for its loop causing invalid
          free. Added internal unit test to unbound-dnstap-socket for that.
+       - Fix that the worker mem report with alloc stats does not attempt
+         to print memory use of forwards and hints if they have been
+         deleted already.
 
 31 July 2024: Wouter
        - Fix for #1114: Fix that cache fill for forward-host names is