From: W.C.A. Wijngaards Date: Fri, 17 Apr 2026 11:48:38 +0000 (+0200) Subject: - Fix subnet store of servfail to not leak memory. X-Git-Tag: release-1.25.0rc1~19 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=af209a12ea7fa048d27457d987e51d47bfb87245;p=thirdparty%2Funbound.git - Fix subnet store of servfail to not leak memory. --- 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) {