]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix subnet store of servfail to not leak memory.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 17 Apr 2026 11:48:38 +0000 (13:48 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 17 Apr 2026 11:48:38 +0000 (13:48 +0200)
doc/Changelog
edns-subnet/subnetmod.c

index 78fe93c99576e5059537857fa5fa4404c1464297..46beae15fa5641d49ccb97b47632cf81114c05c1 100644 (file)
@@ -14,6 +14,7 @@
        - Fix to increase size of the buffer for the win_svc reportev log
          function.
        - Fix ttl comparisons in rdata_copy for 32bit signed or unsigned.
+       - Fix subnet store of servfail to not leak memory.
 
 16 April 2026: Yorgos
        - Merge #1406: Introduce new 'tls-protocols' configuration option.
index ba600ae0e3b1d10a1be350d5163383c656a9c7d0..587839faa6dfb4577f173feca90141b18462b126 100644 (file)
@@ -452,8 +452,13 @@ update_cache(struct module_qstate *qstate, int id)
                diff_size = (data->reason_fail?strlen(data->reason_fail)+1:0)
                        - diff_size;
                lock_rw_unlock(&lru_entry->lock);
-               slabhash_update_space_used(subnet_msg_cache, h, NULL,
-                       diff_size);
+               if (need_to_insert) {
+                       slabhash_insert(subnet_msg_cache, h, lru_entry,
+                               lru_entry->data, NULL);
+               } else {
+                       slabhash_update_space_used(subnet_msg_cache, h, NULL,
+                               diff_size);
+               }
                return;
        }
        if(!qstate->return_msg) {