From 800f5a2a254c8be8219d92de08debc3cf0a7bd1b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 30 Mar 2010 22:55:06 +0200 Subject: [PATCH] target_scale: Fixed a `break strict-aliasing rules' compiler warning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … identified by GCC 4.4.3 using -O3. --- src/target_scale.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/target_scale.c b/src/target_scale.c index 6b261c7c..29fecdfd 100644 --- a/src/target_scale.c +++ b/src/target_scale.c @@ -302,11 +302,15 @@ static int ts_config_set_double (double *ret, oconfig_item_t *ci) /* {{{ */ static int ts_destroy (void **user_data) /* {{{ */ { + ts_data_t **data; + if (user_data == NULL) return (-EINVAL); - free (*user_data); - *user_data = NULL; + data = (ts_data_t **) user_data; + + free (*data); + *data = NULL; return (0); } /* }}} int ts_destroy */ -- 2.30.2