projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.conf.pod: fix minor typos in ntpd plugin section
[collectd.git]
/
src
/
target_scale.c
diff --git
a/src/target_scale.c
b/src/target_scale.c
index
6bcbb05
..
bef03e5
100644
(file)
--- a/
src/target_scale.c
+++ b/
src/target_scale.c
@@
-366,22
+366,23
@@
static int ts_config_add_data_source(ts_data_t *data, /* {{{ */
static int ts_destroy (void **user_data) /* {{{ */
{
static int ts_destroy (void **user_data) /* {{{ */
{
- ts_data_t *
*
data;
+ ts_data_t *data;
if (user_data == NULL)
return (-EINVAL);
if (user_data == NULL)
return (-EINVAL);
- data = (ts_data_t *
*)
user_data;
+ data = (ts_data_t *
) *
user_data;
- if (*data && (*data)->data_sources) {
+ if ((data != NULL) && (data->data_sources != NULL))
+ {
size_t i;
size_t i;
- for (i = 0; i <
(*data)
->data_sources_num; i++)
-
free((*data)
->data_sources[i]);
-
free((*data)
->data_sources);
+ for (i = 0; i <
data
->data_sources_num; i++)
+
sfree (data
->data_sources[i]);
+
sfree (data
->data_sources);
}
}
-
free (*
data);
- *data = NULL;
+
sfree (
data);
+ *
user_
data = NULL;
return (0);
} /* }}} int ts_destroy */
return (0);
} /* }}} int ts_destroy */