Add check for NULL authenticator

The server creation was missing a check for NULL authenticator parameter.
This commit is contained in:
Markus Makela 2016-11-11 12:07:00 +02:00
parent 0a712017a8
commit 8a8e1a6650

View File

@ -1264,6 +1264,7 @@ bool server_create(const char *name, const char *address, const char *port,
if (server_find_by_unique_name(name) == NULL)
{
// TODO: Get default values from the protocol module
if (port == NULL)
{
port = "3306";
@ -1272,6 +1273,12 @@ bool server_create(const char *name, const char *address, const char *port,
{
protocol = "MySQLBackend";
}
if (authenticator == NULL && (authenticator = get_default_authenticator(protocol)) == NULL)
{
MXS_ERROR("No authenticator defined for server '%s' and no default "
"authenticator for protocol '%s'.", name, protocol);
return false;
}
/** First check if this service has been created before */
SERVER *server = find_destroyed_server(name, protocol, authenticator,