MXS-2556 Don't crash if authenticator not found

This commit is contained in:
Johan Wikman
2019-06-10 17:53:07 +03:00
parent a2b046a482
commit b2f44cefe7

View File

@ -176,14 +176,15 @@ Server* Server::server_alloc(const char* name, const MXS_CONFIG_PARAMETER& param
if (authenticator.empty()) if (authenticator.empty())
{ {
authenticator = get_default_authenticator(protocol.c_str()); const char* zAuthenticator = get_default_authenticator(protocol.c_str());
if (authenticator.empty()) if (!zAuthenticator)
{ {
MXS_ERROR("No authenticator defined for server '%s' and no default " MXS_ERROR("No authenticator defined for server '%s' and no default "
"authenticator for protocol '%s'.", "authenticator for protocol '%s'.",
name, protocol.c_str()); name, protocol.c_str());
return NULL; return NULL;
} }
authenticator = zAuthenticator;
} }
void* auth_instance = NULL; void* auth_instance = NULL;