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())
{
authenticator = get_default_authenticator(protocol.c_str());
if (authenticator.empty())
const char* zAuthenticator = get_default_authenticator(protocol.c_str());
if (!zAuthenticator)
{
MXS_ERROR("No authenticator defined for server '%s' and no default "
"authenticator for protocol '%s'.",
name, protocol.c_str());
return NULL;
}
authenticator = zAuthenticator;
}
void* auth_instance = NULL;