From: Yorgos Thessalonikefs Date: Fri, 31 May 2024 10:09:35 +0000 (+0200) Subject: - Fix memory leak when reload_keep_cache is used and num-threads changes. X-Git-Tag: release-1.21.0rc1~62^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=486985fbdf2359242f72ea29687ec6782a4062d7;p=thirdparty%2Funbound.git - Fix memory leak when reload_keep_cache is used and num-threads changes. --- diff --git a/daemon/daemon.c b/daemon/daemon.c index f0ee329db..dbb6db060 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -503,7 +503,10 @@ daemon_clear_allocs(struct daemon* daemon) { int i; - for(i=0; inum; i++) { + /* daemon->num may be different during reloads (after configuration + * read). Use old_num which has the correct value used to setup the + * worker_allocs */ + for(i=0; iold_num; i++) { alloc_clear(daemon->worker_allocs[i]); free(daemon->worker_allocs[i]); }