summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06fd8d2)
raw | patch | inline | side by side (parent: 06fd8d2)
author | Florian Forster <octo@collectd.org> | |
Sun, 19 Feb 2012 21:33:45 +0000 (22:33 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 19 Feb 2012 21:33:45 +0000 (22:33 +0100) |
Change-Id: I5a992fe0b0206455bf910a739927f2243b05b89b
src/target_scale.c | patch | blob | history |
diff --git a/src/target_scale.c b/src/target_scale.c
index 6bcbb05580a3be2f9184f67f1e12ddf25b88fcdf..bef03e58769cd147ee6fcf0efe8f15cf87f46c43 100644 (file)
--- a/src/target_scale.c
+++ b/src/target_scale.c
static int ts_destroy (void **user_data) /* {{{ */
{
- ts_data_t **data;
+ ts_data_t *data;
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;
- 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 */