Fixed issue with MaxScale crash if a configuration unknown section

without a type is added. This is Bgzilla bug 378.
This commit is contained in:
Mark Riddoch 2014-02-05 10:48:52 +01:00
parent 0a13bf9989
commit fb8212543a

View File

@ -837,17 +837,19 @@ int i;
obj = context;
while (obj)
{
type = config_get_value(obj->parameters, "type");
if (!strcmp(type, "service"))
param_set = service_params;
else if (!strcmp(type, "server"))
param_set = server_params;
else if (!strcmp(type, "listener"))
param_set = listener_params;
else if (!strcmp(type, "monitor"))
param_set = monitor_params;
else
param_set = NULL;
param_set = NULL;
if (obj->parameters &&
(type = config_get_value(obj->parameters, "type")))
{
if (!strcmp(type, "service"))
param_set = service_params;
else if (!strcmp(type, "server"))
param_set = server_params;
else if (!strcmp(type, "listener"))
param_set = listener_params;
else if (!strcmp(type, "monitor"))
param_set = monitor_params;
}
if (param_set != NULL)
{
params = obj->parameters;