return (0);
} /* }}} int powerdns_read_recursor */
-static int powerdns_config_add_string (const char *name, /* {{{ */
- char **dest,
- oconfig_item_t *ci)
-{
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
- {
- WARNING ("powerdns plugin: `%s' needs exactly one string argument.",
- name);
- return (-1);
- }
-
- sfree (*dest);
- *dest = strdup (ci->values[0].value.string);
- if (*dest == NULL)
- return (-1);
-
- return (0);
-} /* }}} int powerdns_config_add_string */
-
static int powerdns_config_add_collect (list_item_t *li, /* {{{ */
oconfig_item_t *ci)
{
if (strcasecmp ("Collect", option->key) == 0)
status = powerdns_config_add_collect (item, option);
else if (strcasecmp ("Socket", option->key) == 0)
- status = powerdns_config_add_string ("Socket", &socket_temp, option);
+ status = cf_util_get_string (option, &socket_temp);
else
{
ERROR ("powerdns plugin: Option `%s' not allowed here.", option->key);
if (status != 0)
{
+ sfree (socket_temp);
sfree (item);
return (-1);
}
DEBUG ("powerdns plugin: Add server: instance = %s;", item->instance);
+ sfree (socket_temp);
return (0);
} /* }}} int powerdns_config_add_server */