From: Sebastian Harl Date: Tue, 30 Mar 2010 20:55:06 +0000 (+0200) Subject: target_scale: Fixed a `break strict-aliasing rules' compiler warning. X-Git-Tag: collectd-4.10.0~31 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=800f5a2a254c8be8219d92de08debc3cf0a7bd1b;p=collectd.git target_scale: Fixed a `break strict-aliasing rules' compiler warning. … identified by GCC 4.4.3 using -O3. --- 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 */