X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_cache.c;h=45444c7f912b4575984ca1937240beb3ce04ba12;hb=9de86bc9ce5961281632944a04efbc2314828a2f;hp=76213955ca168dc17c9b01833b15fdd5afe3c517;hpb=a09f2fdf0450eb76317e1b7575a12ffb926068f4;p=collectd.git diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index 76213955..45444c7f 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -193,12 +193,13 @@ static int uc_insert (const data_set_t *ds, const value_list_t *vl, / CDTIME_T_TO_DOUBLE (vl->interval); ce->values_raw[i].absolute = vl->values[i].absolute; break; - + default: /* This shouldn't happen. */ ERROR ("uc_insert: Don't know how to handle data source type %i.", ds->ds[i].type); sfree (key_copy); + cache_free (ce); return (-1); } /* switch (ds->ds[i].type) */ } /* for (i) */ @@ -576,7 +577,7 @@ gauge_t *uc_get_rate (const data_set_t *ds, const value_list_t *vl) return (ret); } /* gauge_t *uc_get_rate */ -size_t uc_get_size() { +size_t uc_get_size (void) { size_t size_arrays = 0; pthread_mutex_lock (&cache_lock); @@ -753,7 +754,6 @@ int uc_get_history_by_name (const char *name, if (ce->history_length < num_steps) { gauge_t *tmp; - size_t i; tmp = realloc (ce->history, sizeof (*ce->history) * num_steps * ce->values_num);