add check for empty hosts' list

This commit is contained in:
Pinkbyte committed 2011-11-25 17:42:48 +04:00
1 parent bc7c1edb41
commit ab22d61262
1 file changed
+7 -1
+7 -1
View File
@@ -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