From 6cbcea3ac75e8bd5e84459013dafff7e5b9db7e3 Mon Sep 17 00:00:00 2001 From: Petr Vaganov Date: Fri, 26 Jun 2026 18:42:29 +0700 Subject: [PATCH] daemon: fix DEREF_AFTER_NULL.EX.COND on worker_init (#1467) Found by the static analyzer Svace (ISP RAS). After having been compared to a NULL value at worker.c:2216, pointer 'worker->stat_timer' is passed in call to function 'worker_restart_timer' at worker.c:2319,where it is dereferenced at worker.c:2029. Fix that stat_timer creation failure in worker_init does not continue with a NULL timer that causes a crash later. Signed-off-by: Petr Vaganov --- daemon/worker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/worker.c b/daemon/worker.c index 5da8f76a7..7d76ffee0 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -2383,6 +2383,8 @@ worker_init(struct worker* worker, struct config_file *cfg, worker_stat_timer_cb, worker); if(!worker->stat_timer) { log_err("could not create statistics timer"); + worker_delete(worker); + return 0; } /* we use the msg_buffer_size as a good estimate for what the