- Fix memory leak when reload_keep_cache is used and num-threads changes.

This commit is contained in:
Yorgos Thessalonikefs 2024-05-31 12:09:35 +02:00
parent caab100207
commit 486985fbdf

View file

@ -503,7 +503,10 @@ daemon_clear_allocs(struct daemon* daemon)
{
int i;
for(i=0; i<daemon->num; 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; i<daemon->old_num; i++) {
alloc_clear(daemon->worker_allocs[i]);
free(daemon->worker_allocs[i]);
}