X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_cache.c;h=7f0d228f095c02faf43296c0af0f4889b5231e1f;hb=1ebf2f31;hp=0756807334b7b4eba7bf05bb3757c3917de63878;hpb=6894d846ac42cbe88073db074d75279f5a6e31b8;p=collectd.git diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index 07568073..7f0d228f 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -83,7 +83,7 @@ static cache_entry_t *cache_alloc (size_t values_num) { cache_entry_t *ce; - ce = (cache_entry_t *) malloc (sizeof (cache_entry_t)); + ce = malloc (sizeof (*ce)); if (ce == NULL) { ERROR ("utils_cache: cache_alloc: malloc failed."); @@ -499,7 +499,7 @@ int uc_get_rate_by_name (const char *name, gauge_t **ret_values, size_t *ret_val else { ret_num = ce->values_num; - ret = (gauge_t *) malloc (ret_num * sizeof (gauge_t)); + ret = malloc (ret_num * sizeof (*ret)); if (ret == NULL) { ERROR ("utils_cache: uc_get_rate_by_name: malloc failed.");