Fixed a crash when a monitor has no servers

If a monitor is configured with a server which does not exist, MaxScale will
crash.
This commit is contained in:
Markus Makela 2016-03-15 16:37:12 +02:00
parent 5687916846
commit bc35730c73

View File

@ -538,6 +538,12 @@ bool check_monitor_permissions(MONITOR* monitor)
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, &cnf->auth_conn_timeout);
mysql_options(mysql, MYSQL_OPT_WRITE_TIMEOUT, &cnf->auth_write_timeout);
if (monitor->databases == NULL)
{
MXS_ERROR("%s: Monitor is missing the servers parameter.", monitor->name);
return false;
}
user = monitor->user;
dpasswd = decryptPassword(monitor->password);
server = monitor->databases->server;