From 83d8820b6e8532c94c182f88bbb199c8522d76ae Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 19 Feb 2012 22:33:45 +0100 Subject: [PATCH] target_scale plugin: Coding style fixes. Change-Id: I5a992fe0b0206455bf910a739927f2243b05b89b --- src/target_scale.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 */ -- 2.30.2