From: Florian Forster Date: Sun, 19 Feb 2012 21:33:45 +0000 (+0100) Subject: target_scale plugin: Coding style fixes. X-Git-Tag: collectd-5.1.0~32 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=83d8820b6e8532c94c182f88bbb199c8522d76ae;p=collectd.git target_scale plugin: Coding style fixes. Change-Id: I5a992fe0b0206455bf910a739927f2243b05b89b --- diff --git a/src/target_scale.c b/src/target_scale.c index 6bcbb055..bef03e58 100644 --- 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) /* {{{ */ { - 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 */