- ERROR ("Unable to allocate memory for normalized plugin buffer");
- return (-1);
- }
-
- if ((n_type = malloc(strlen(type)+1)) == NULL)
- {
- ERROR ("Unable to allocate memory for normalized type buffer");
- return (-1);
- }
-
- swap_chars(n_hostname, hostname, '.', dotchar);
- swap_chars(n_plugin, plugin, ' ', '_');
- swap_chars(n_type, type, ' ', '_');
-
- if (type_instance != NULL && type_instance[0] != '\0')
- {
- if ((n_type_instance = malloc(strlen(type_instance)+1)) == NULL)
- {
- ERROR ("Unable to allocate memory for normalized datasource name buffer");
- return (-1);
- }
- swap_chars(n_type_instance, type_instance, '.', dotchar);
- swap_chars(n_type_instance, type_instance, ' ', '_');
- }
-
- if (plugin_instance != NULL && plugin_instance[0] != '\0')
- {
- if ((n_plugin_instance = malloc(strlen(plugin_instance)+1)) == NULL)