add check for empty hosts' list
This commit is contained in:
1 parent
bc7c1edb41
commit
ab22d61262
1 file changed
+7
-1
@@ -63,8 +63,14 @@ void init()
|
||||
log_event("Error parsing config file");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// allocate memory for hosts array...
|
||||
// hosts' array must not be empty
|
||||
hosts_count=cfg_size(cfg,"hosts");
|
||||
if (hosts_count==0)
|
||||
{
|
||||
log_event("Error: no hosts to check defined in config file");
|
||||
exit | ||||