From: W.C.A. Wijngaards Date: Tue, 23 Jan 2024 08:56:07 +0000 (+0100) Subject: - fast-reload, fix clang analyzer warnings. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b28f671e18e326bb16b660eda4dab03641e0d765;p=thirdparty%2Funbound.git - fast-reload, fix clang analyzer warnings. --- diff --git a/daemon/remote.c b/daemon/remote.c index 2cc981cc4..aa7f6e2f9 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -3766,7 +3766,7 @@ fr_construct_clear(struct fast_reload_construct* ct) hints_delete(ct->hints); /* Delete the log identity here so that the global value is not * reset by config_delete. */ - if(ct->oldcfg->log_identity) { + if(ct->oldcfg && ct->oldcfg->log_identity) { free(ct->oldcfg->log_identity); ct->oldcfg->log_identity = NULL; } @@ -3848,6 +3848,11 @@ fr_reload_config(struct fast_reload_thread* fr, struct config_file* newcfg, struct daemon* daemon = fr->worker->daemon; struct module_env* env = daemon->env; + /* These are constructed in the fr_construct_from_config routine. */ + log_assert(ct->oldcfg); + log_assert(ct->fwds); + log_assert(ct->hints); + /* Grab big locks to satisfy lock conditions. */ lock_rw_wrlock(&ct->fwds->lock); lock_rw_wrlock(&ct->hints->lock);