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; obj = context;
while (obj) while (obj)
{ {
type = config_get_value(obj->parameters, "type"); param_set = NULL;
if (!strcmp(type, "service")) if (obj->parameters &&
param_set = service_params; (type = config_get_value(obj->parameters, "type")))
else if (!strcmp(type, "server")) {
param_set = server_params; if (!strcmp(type, "service"))
else if (!strcmp(type, "listener")) param_set = service_params;
param_set = listener_params; else if (!strcmp(type, "server"))
else if (!strcmp(type, "monitor")) param_set = server_params;
param_set = monitor_params; else if (!strcmp(type, "listener"))
else param_set = listener_params;
param_set = NULL; else if (!strcmp(type, "monitor"))
param_set = monitor_params;
}
if (param_set != NULL) if (param_set != NULL)
{ {
params = obj->parameters; params = obj->parameters;