DaMon: do not keep hosts when unable to initialize

This commit is contained in:
Pierre Pronchery 2022-05-22 03:50:34 +02:00
parent c51b4b126f
commit 4e8f4d4c97

View File

@ -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;
}