diff --git a/doc/Changelog b/doc/Changelog index 78fe93c99..46beae15f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/edns-subnet/subnetmod.c b/edns-subnet/subnetmod.c index ba600ae0e..587839faa 100644 --- a/edns-subnet/subnetmod.c +++ b/edns-subnet/subnetmod.c @@ -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) {