curl_easy_cleanup(st->curl);
st->curl = NULL;
}
+ sfree (st);
} /* apache_free */
static size_t apache_curl_callback (void *buf, size_t size, size_t nmemb,
openlog ("collectdmon", LOG_CONS | LOG_PID, LOG_DAEMON);
if (-1 == daemonize ())
+ {
+ free (collectd_argv);
return 1;
+ }
sa.sa_handler = sig_int_term_handler;
sa.sa_flags = 0;
if (0 != sigaction (SIGINT, &sa, NULL)) {
syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno));
+ free (collectd_argv);
return 1;
}
if (0 != sigaction (SIGTERM, &sa, NULL)) {
syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno));
+ free (collectd_argv);
return 1;
}
if (0 != sigaction (SIGHUP, &sa, NULL)) {
syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno));
+ free (collectd_argv);
return 1;
}
} /* while (status == 0) */
if (status != 0)
+ {
+ cc_web_match_free (match);
return (status);
+ }
match->match = match_create_simple (match->regex, match->exclude_regex,
match->dstype);
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
+ cj_key_free (key);
return (-1);
}
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
+ cj_free (db);
return (-1);
}
if (status != 0)
{
ERROR ("curl_xml plugin: cx_config: "
"Invalid key: %s", ci->key);
+ cx_free (db);
return (-1);
}
pthread_mutex_unlock (&cache_lock);
if (keys_len == 0)
+ {
+ /* realloc() may have been called for these. */
+ sfree (keys);
+ sfree (keys_time);
+ sfree (keys_interval);
return (0);
+ }
/* Call the "missing" callback for each value. Do this before removing the
* value from the cache, so that callbacks can still access the data stored,
if (status != 0)
{
size_t i;
-
+
for (i = 0; i < number; i++)
{
sfree (names[i]);
}
sfree (names);
+ sfree (times);
return (-1);
}
*ret_names = names;
if (ret_times != NULL)
*ret_times = times;
+ else
+ sfree (times);
*ret_number = number;
return (0);
struct addrinfo *ai_ptr;
int ai_return;
- socket_entry_t *sockets;
- size_t sockets_num;
+ socket_entry_t *sockets = NULL;
+ size_t sockets_num = 0;
int status;
-
- sockets = *ret_sockets;
- sockets_num = *ret_sockets_num;
+
+ if (*ret_sockets != NULL)
+ return (EINVAL);
memset (&ai_hints, 0, sizeof (ai_hints));
ai_hints.ai_flags = 0;
freeaddrinfo (ai_list);
- if ((*ret_sockets_num) >= sockets_num)
+ if (sockets_num == 0)
+ {
+ sfree (sockets);
return (-1);
+ }
*ret_sockets = sockets;
*ret_sockets_num = sockets_num;
int i = 0;
if (0 != get_pi (se, pi, sizeof (pi)))
+ {
+ free (dests);
return;
+ }
cipvs_submit_connections (pi, NULL, stats.conns);
cipvs_submit_if (pi, "if_packets", NULL, stats.inpkts, stats.outpkts);
pthread_mutex_unlock (&java_callbacks_lock);
ERROR ("java plugin: cjni_callback_info_create: strdup failed.");
(*jvm_env)->ReleaseStringUTFChars (jvm_env, o_name, c_name);
+ sfree (cbi);
return (NULL);
}
if (cbi->object == NULL)
{
ERROR ("java plugin: cjni_callback_info_create: NewGlobalRef failed.");
- free (cbi);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}
if (cbi->class == NULL)
{
ERROR ("java plugin: cjni_callback_info_create: GetObjectClass failed.");
- free (cbi);
+ (*jvm_env)->DeleteGlobalRef (jvm_env, cbi->object);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}
ERROR ("java plugin: cjni_callback_info_create: "
"Cannot find the `%s' method with signature `%s'.",
method_name, method_signature);
- free (cbi);
+ (*jvm_env)->DeleteGlobalRef (jvm_env, cbi->object);
+ sfree (cbi->name);
+ sfree (cbi);
return (NULL);
}
} /* while (status == 0) */
if (status != 0)
+ {
+ cmc_web_match_free (match);
return (status);
+ }
match->match = match_create_simple (match->regex, match->exclude_regex,
match->dstype);
static int openvpn_read (void)
{
FILE *fh;
- int i, vpn_read, read;
+ int i, read;
- vpn_read = read = 0;
+ read = 0;
/* call the right read function for every status entry in the list */
for (i = 0; i < vpn_num; i++)
{
+ int vpn_read = 0;
+
fh = fopen (vpn_list[i]->file, "r");
if (fh == NULL)
{
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 */
new_rc = 1;
}
+ assert (value_time > 0); /* plugin_dispatch() ensures this. */
if (rc->last_value >= value_time)
{
pthread_mutex_unlock (&cache_lock);
return (-1);
}
assert (ds->ds_num == data->values_len);
+ assert (data->values_len > 0);
instance_list_ptr = instance_list;
- value_table_ptr = malloc (sizeof (*value_table_ptr) * data->values_len);
+ value_table_ptr = calloc ((size_t) data->values_len, sizeof (*value_table_ptr));
if (value_table_ptr == NULL)
return (-1);
for (i = 0; i < data->values_len; i++)
value_table_ptr[i] = value_table[i];
- vl.values_len = ds->ds_num;
+ vl.values_len = data->values_len;
vl.values = malloc (sizeof (*vl.values) * vl.values_len);
if (vl.values == NULL)
{
if (state == STATE_OKAY)
{
if (state_old == STATE_MISSING)
- status = ssnprintf (buf, bufsize,
- ": Value is no longer missing.");
+ ssnprintf (buf, bufsize, ": Value is no longer missing.");
else
- status = ssnprintf (buf, bufsize,
+ ssnprintf (buf, bufsize,
": All data sources are within range again. "
"Current value of \"%s\" is %f.",
ds->ds[ds_index].name, values[ds_index]);
{
if (!isnan (min) && !isnan (max))
{
- status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
+ ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
"%f. That is within the %s region of %f%s and %f%s.",
ds->ds[ds_index].name, values[ds_index],
(state == STATE_ERROR) ? "failure" : "warning",
}
else
{
- status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
- "%f. That is %s the %s threshold of %f%s.",
- ds->ds[ds_index].name, values[ds_index],
- isnan (min) ? "below" : "above",
- (state == STATE_ERROR) ? "failure" : "warning",
- isnan (min) ? max : min,
- ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "");
+ ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
+ "%f. That is %s the %s threshold of %f%s.",
+ ds->ds[ds_index].name, values[ds_index],
+ isnan (min) ? "below" : "above",
+ (state == STATE_ERROR) ? "failure" : "warning",
+ isnan (min) ? max : min,
+ ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "");
}
}
else if (th->flags & UT_FLAG_PERCENTAGE)
else
value = 100.0 * values[ds_index] / sum;
- status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
+ ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
"%g (%.2f%%). That is %s the %s threshold of %.2f%%.",
ds->ds[ds_index].name, values[ds_index], value,
(value < min) ? "below" : "above",
}
else /* is not inverted */
{
- status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
- "%f. That is %s the %s threshold of %f.",
- ds->ds[ds_index].name, values[ds_index],
- (values[ds_index] < min) ? "below" : "above",
- (state == STATE_ERROR) ? "failure" : "warning",
- (values[ds_index] < min) ? min : max);
+ ssnprintf (buf, bufsize, ": Data source \"%s\" is currently "
+ "%f. That is %s the %s threshold of %f.",
+ ds->ds[ds_index].name, values[ds_index],
+ (values[ds_index] < min) ? "below" : "above",
+ (state == STATE_ERROR) ? "failure" : "warning",
+ (values[ds_index] < min) ? min : max);
}
}
unsigned int i;
unsigned int total_threads, total_cores;
+ if ((topology.num_threads == 0)
+ || (topology.num_cores == 0)
+ || (topology.num_packages == 0))
+ {
+ ERROR ("turbostat plugin: Invalid topology: %u threads, %u cores, %u packages",
+ topology.num_threads, topology.num_cores, topology.num_packages);
+ return -1;
+ }
+
total_threads = topology.num_threads * topology.num_cores * topology.num_packages;
*threads = calloc(total_threads, sizeof(struct thread_data));
if (*threads == NULL)
- goto err;
+ {
+ ERROR ("turbostat plugin: calloc failed");
+ return -1;
+ }
for (i = 0; i < total_threads; ++i)
(*threads)[i].cpu_id = topology.max_cpu_id + 1;
total_cores = topology.num_cores * topology.num_packages;
*cores = calloc(total_cores, sizeof(struct core_data));
if (*cores == NULL)
- goto err_clean_threads;
+ {
+ ERROR ("turbostat plugin: calloc failed");
+ sfree (threads);
+ return -1;
+ }
*packages = calloc(topology.num_packages, sizeof(struct pkg_data));
if (*packages == NULL)
- goto err_clean_cores;
+ {
+ ERROR ("turbostat plugin: calloc failed");
+ sfree (cores);
+ sfree (threads);
+ return -1;
+ }
return 0;
-
-err_clean_cores:
- free(*cores);
-err_clean_threads:
- free(*threads);
-err:
- ERROR("turbostat plugin: Failled to allocate memory for counters");
- return -1;
}
static void
#include "plugin.h"
#include "utils_parse_option.h"
-#define print_to_socket(fh, ...) \
- do { \
- if (fprintf (fh, __VA_ARGS__) < 0) { \
- char errbuf[1024]; \
- WARNING ("handle_flush: failed to write to socket #%i: %s", \
- fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \
- return -1; \
- } \
- fflush(fh); \
- } while (0)
-
-static int add_to_array (char ***array, int *array_num, char *value)
-{
- char **temp;
-
- temp = (char **) realloc (*array, sizeof (char *) * (*array_num + 1));
- if (temp == NULL)
- return (-1);
-
- *array = temp;
- (*array)[*array_num] = value;
- (*array_num)++;
-
- return (0);
-} /* int add_to_array */
-
int handle_flush (FILE *fh, char *buffer)
{
int success = 0;
double timeout = 0.0;
char **plugins = NULL;
- int plugins_num = 0;
+ size_t plugins_num = 0;
char **identifiers = NULL;
- int identifiers_num = 0;
+ size_t identifiers_num = 0;
- int i;
+ size_t i;
+
+#define PRINT_TO_SOCK(fh, ...) \
+ do { \
+ if (fprintf (fh, __VA_ARGS__) < 0) { \
+ char errbuf[1024]; \
+ WARNING ("handle_flush: failed to write to socket #%i: %s", \
+ fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \
+ strarray_free (plugins, plugins_num); \
+ strarray_free (identifiers, identifiers_num); \
+ return -1; \
+ } \
+ fflush(fh); \
+ } while (0)
if ((fh == NULL) || (buffer == NULL))
return (-1);
if (strncasecmp ("FLUSH", buffer, strlen ("FLUSH")) != 0)
{
- print_to_socket (fh, "-1 Cannot parse command.\n");
+ PRINT_TO_SOCK (fh, "-1 Cannot parse command.\n");
return (-1);
}
buffer += strlen ("FLUSH");
status = parse_option (&buffer, &opt_key, &opt_value);
if (status != 0)
{
- print_to_socket (fh, "-1 Parsing options failed.\n");
- sfree (plugins);
- sfree (identifiers);
+ PRINT_TO_SOCK (fh, "-1 Parsing options failed.\n");
+ strarray_free (plugins, plugins_num);
+ strarray_free (identifiers, identifiers_num);
return (-1);
}
if (strcasecmp ("plugin", opt_key) == 0)
- {
- add_to_array (&plugins, &plugins_num, opt_value);
- }
+ strarray_add (&plugins, &plugins_num, opt_value);
else if (strcasecmp ("identifier", opt_key) == 0)
- {
- add_to_array (&identifiers, &identifiers_num, opt_value);
- }
+ strarray_add (&identifiers, &identifiers_num, opt_value);
else if (strcasecmp ("timeout", opt_key) == 0)
{
char *endptr;
-
+
errno = 0;
endptr = NULL;
timeout = strtod (opt_value, &endptr);
if ((endptr == opt_value) || (errno != 0) || (!isfinite (timeout)))
{
- print_to_socket (fh, "-1 Invalid value for option `timeout': "
+ PRINT_TO_SOCK (fh, "-1 Invalid value for option `timeout': "
"%s\n", opt_value);
- sfree (plugins);
- sfree (identifiers);
+ strarray_free (plugins, plugins_num);
+ strarray_free (identifiers, identifiers_num);
return (-1);
}
else if (timeout < 0.0)
}
else
{
- print_to_socket (fh, "-1 Cannot parse option %s\n", opt_key);
- sfree (plugins);
- sfree (identifiers);
+ PRINT_TO_SOCK (fh, "-1 Cannot parse option %s\n", opt_key);
+ strarray_free (plugins, plugins_num);
+ strarray_free (identifiers, identifiers_num);
return (-1);
}
} /* while (*buffer != 0) */
- /* Add NULL entries for `any plugin' and/or `any value' if nothing was
- * specified. */
- if (plugins_num == 0)
- add_to_array (&plugins, &plugins_num, NULL);
-
- if (identifiers_num == 0)
- add_to_array (&identifiers, &identifiers_num, NULL);
-
- for (i = 0; i < plugins_num; i++)
+ for (i = 0; (i == 0) || (i < plugins_num); i++)
{
- char *plugin;
+ char *plugin = NULL;
int j;
- plugin = plugins[i];
+ if (plugins_num != 0)
+ plugin = plugins[i];
- for (j = 0; j < identifiers_num; j++)
+ for (j = 0; (j == 0) || (j < identifiers_num); j++)
{
- char *identifier;
+ char *identifier = NULL;
int status;
- identifier = identifiers[j];
+ if (identifiers_num != 0)
+ identifier = identifiers[j];
+
status = plugin_flush (plugin,
DOUBLE_TO_CDTIME_T (timeout),
identifier);
}
}
- if ((success + error) > 0)
- {
- print_to_socket (fh, "0 Done: %i successful, %i errors\n",
- success, error);
- }
- else
- {
- plugin_flush (NULL, DOUBLE_TO_CDTIME_T (timeout), NULL);
- print_to_socket (fh, "0 Done\n");
- }
+ PRINT_TO_SOCK (fh, "0 Done: %i successful, %i errors\n",
+ success, error);
- sfree (plugins);
- sfree (identifiers);
+ strarray_free (plugins, plugins_num);
+ strarray_free (identifiers, identifiers_num);
return (0);
+#undef PRINT_TO_SOCK
} /* int handle_flush */
/* vim: set sw=4 ts=4 tw=78 noexpandtab : */
char errbuf[1024]; \
WARNING ("handle_putval: failed to write to socket #%i: %s", \
fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \
+ sfree (vl.values); \
return -1; \
} \
fflush(fh); \
} while (0)
-static int dispatch_values (const data_set_t *ds, value_list_t *vl,
- FILE *fh, char *buffer)
-{
- int status;
-
- status = parse_values (buffer, vl, ds);
- if (status != 0)
- {
- print_to_socket (fh, "-1 Parsing the values string failed.\n");
- return (-1);
- }
-
- plugin_dispatch_values (vl);
- return (0);
-} /* int dispatch_values */
-
static int set_option (value_list_t *vl, const char *key, const char *value)
{
if ((vl == NULL) || (key == NULL) || (value == NULL))
const data_set_t *ds;
value_list_t vl = VALUE_LIST_INIT;
+ vl.values = NULL;
DEBUG ("utils_cmd_putval: handle_putval (fh = %p, buffer = %s);",
(void *) fh, buffer);
/* parse_option failed, buffer has been modified.
* => we need to abort */
print_to_socket (fh, "-1 Misformatted option.\n");
+ sfree (vl.values);
return (-1);
}
else if (status == 0)
if (status != 0)
{
print_to_socket (fh, "-1 Misformatted value.\n");
+ sfree (vl.values);
return (-1);
}
assert (string != NULL);
- status = dispatch_values (ds, &vl, fh, string);
+ status = parse_values (string, &vl, ds);
if (status != 0)
{
- /* An error has already been printed. */
+ print_to_socket (fh, "-1 Parsing the values string failed.\n");
+ sfree (vl.values);
return (-1);
}
+
+ plugin_dispatch_values (&vl);
values_submitted++;
} /* while (*buffer != 0) */
/* Done parsing the options. */
values_submitted,
(values_submitted == 1) ? "value has" : "values have");
- sfree (vl.values);
-
+ sfree (vl.values);
return (0);
} /* int handle_putval */
if (errsize)
sfree (regerr);
regfree (regtemp);
+ sfree (regtemp);
return (1);
}
DEBUG("regex compiled: %s - %i", entry, rcompile);
{
ERROR ("cannot allocate new config entry");
regfree (regtemp);
+ sfree (regtemp);
return (1);
}
memset (new, '\0', sizeof(ignorelist_item_t));
if (this->rmatch != NULL)
{
regfree (this->rmatch);
+ sfree (this->rmatch);
this->rmatch = NULL;
}
#endif
lc = malloc (sizeof (*lc));
if (lc == NULL)
return (NULL);
+ memset (lc, 0, sizeof (*lc));
latency_counter_reset (lc);
lc->bin_width = HISTOGRAM_DEFAULT_BIN_WIDTH;
int rra_max;
- int span;
-
int cdp_num;
int cdp_len;
int i, j;
- char buffer[128];
-
/* The stepsize we use here: If it is user-set, use it. If not, use the
* interval of the value-list. */
int ss;
}
rra_max = rts_num * rra_types_num;
+ assert (rra_max > 0);
- if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL)
+ if ((rra_def = malloc ((rra_max + 1) * sizeof (*rra_def))) == NULL)
return (-1);
- memset (rra_def, '\0', (rra_max + 1) * sizeof (char *));
+ memset (rra_def, 0, (rra_max + 1) * sizeof (*rra_def));
rra_num = 0;
cdp_len = 0;
for (i = 0; i < rts_num; i++)
{
- span = rts[i];
+ int span = rts[i];
if ((span / ss) < cfg->rrarows)
span = ss * cfg->rrarows;
for (j = 0; j < rra_types_num; j++)
{
+ char buffer[128];
int status;
if (rra_num >= rra_max)
}
}
+ if (rra_num <= 0)
+ {
+ sfree (rra_def);
+ return (0);
+ }
+
*ret = rra_def;
return (rra_num);
} /* }}} int rra_get */
char max[32];
char buffer[128];
- ds_def = (char **) malloc (ds->ds_num * sizeof (char *));
+ assert (ds->ds_num > 0);
+
+ ds_def = malloc (ds->ds_num * sizeof (*ds_def));
if (ds_def == NULL)
{
char errbuf[1024];
sstrerror (errno, errbuf, sizeof (errbuf)));
return (-1);
}
- memset (ds_def, '\0', ds->ds_num * sizeof (char *));
+ memset (ds_def, 0, ds->ds_num * sizeof (*ds_def));
for (ds_num = 0; ds_num < ds->ds_num; ds_num++)
{
return (-1);
}
+ if (ds_num <= 0)
+ {
+ sfree (ds_def);
+ return (0);
+ }
+
*ret = ds_def;
return (ds_num);
} /* }}} int ds_get */
{
char **argv;
int argc;
- char **rra_def;
+ char **rra_def = NULL;
int rra_num;
- char **ds_def;
+ char **ds_def = NULL;
int ds_num;
int status = 0;
time_t last_up;
if ((ds_num = ds_get (&ds_def, ds, vl, cfg)) < 1)
{
ERROR ("cu_rrd_create_file failed: Could not calculate DSes");
+ rra_free (rra_num, rra_def);
return (-1);
}
char errbuf[1024];
ERROR ("cu_rrd_create_file failed: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));
+ rra_free (rra_num, rra_def);
+ ds_free (ds_num, ds_def);
return (-1);
}
int reference_count;
};
-static char *sensu_tags;
-static char **sensu_attrs;
+static char *sensu_tags = NULL;
+static char **sensu_attrs = NULL;
static size_t sensu_attrs_num;
static int add_str_to_list(struct str_list *strs,
const char *p, *q;
size_t oldlen = strlen(old);
size_t count = strlen(new);
- size_t retlen = count;
+ size_t retlen;
size_t newlen = count;
int samesize = (oldlen == newlen);
sensu_tags_arr.nb_strs = 0;
sensu_tags_arr.strs = NULL;
- sensu_tags = malloc(sizeof(char));
- if (sensu_tags == NULL) {
- ERROR("write_sensu plugin: Unable to alloc memory");
- return -1;
- }
- sensu_tags[0] = '\0';
for (i = 0; i < ci->children_num; i++) {
child = &ci->children[i];
if (strcasecmp("Node", child->key) == 0) {
sensu_config_node(child);
} else if (strcasecmp(child->key, "attribute") == 0) {
- char *key = NULL;
- char *val = NULL;
-
if (child->values_num != 2) {
WARNING("sensu attributes need both a key and a value.");
- free(sensu_tags);
- return -1;
+ continue;
}
if (child->values[0].type != OCONFIG_TYPE_STRING ||
child->values[1].type != OCONFIG_TYPE_STRING) {
WARNING("sensu attribute needs string arguments.");
- free(sensu_tags);
- return -1;
- }
- if ((key = strdup(child->values[0].value.string)) == NULL) {
- ERROR("write_sensu plugin: Unable to alloc memory");
- free(sensu_tags);
- return -1;
- }
- if ((val = strdup(child->values[1].value.string)) == NULL) {
- free(sensu_tags);
- free(key);
- ERROR("write_sensu plugin: Unable to alloc memory");
- return -1;
+ continue;
}
- strarray_add(&sensu_attrs, &sensu_attrs_num, key);
- strarray_add(&sensu_attrs, &sensu_attrs_num, val);
+
+ strarray_add(&sensu_attrs, &sensu_attrs_num, child->values[0].value.string);
+ strarray_add(&sensu_attrs, &sensu_attrs_num, child->values[1].value.string);
+
DEBUG("write_sensu: got attr: %s => %s", key, val);
- sfree(key);
- sfree(val);
} else if (strcasecmp(child->key, "tag") == 0) {
char *tmp = NULL;
status = cf_util_get_string(child, &tmp);
}
}
if (sensu_tags_arr.nb_strs > 0) {
- free(sensu_tags);
+ sfree (sensu_tags);
sensu_tags = build_json_str_list("tags", &sensu_tags_arr);
free_str_list(&sensu_tags_arr);
if (sensu_tags == NULL) {