From 4e8f4d4c97e6c3a57e275ce467f07c3644f306e6 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 22 May 2022 03:50:34 +0200 Subject: [PATCH] DaMon: do not keep hosts when unable to initialize --- src/damon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/damon.c b/src/damon.c index 02dc131..919707b 100644 --- a/src/damon.c +++ b/src/damon.c @@ -274,9 +274,10 @@ static int _init_config_hosts(DaMon * damon, Config * config, + 1))) == NULL) return damon_perror(NULL, -errno); damon->hosts = p; - p = &damon->hosts[damon->hosts_cnt++]; + p = &damon->hosts[damon->hosts_cnt]; if(_init_config_hosts_host(damon, config, p, h, pos) != 0) return -1; + damon->hosts_cnt++; h += pos; pos = 0; }