From 486985fbdf2359242f72ea29687ec6782a4062d7 Mon Sep 17 00:00:00 2001 From: Yorgos Thessalonikefs Date: Fri, 31 May 2024 12:09:35 +0200 Subject: [PATCH] - Fix memory leak when reload_keep_cache is used and num-threads changes. --- daemon/daemon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]); } -- 2.47.2