X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_cache.c;h=b2f2c36b7223b87b53266ed121c3bdc9bc1a27ed;hb=f50ada19dcd0dc6185dc4b410e721d46d1caba9f;hp=241aa726c55bf775159f96b7b448b68f574ae8fe;hpb=fd9c88963b04c9e9050a952ba0f018493e8b7638;p=collectd.git diff --git a/src/utils_cache.c b/src/utils_cache.c index 241aa726..b2f2c36b 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -186,6 +186,7 @@ static int uc_insert (const data_set_t *ds, const value_list_t *vl, ce = cache_alloc (ds->ds_num); if (ce == NULL) { + sfree (key_copy); ERROR ("uc_insert: cache_alloc (%i) failed.", ds->ds_num); return (-1); } @@ -261,6 +262,7 @@ int uc_check_timeout (void) { ERROR ("uc_purge: realloc failed."); c_avl_iterator_destroy (iter); + pthread_mutex_unlock (&cache_lock); return (-1); } @@ -520,7 +522,7 @@ gauge_t *uc_get_rate (const data_set_t *ds, const value_list_t *vl) /* This is important - the caller has no other way of knowing how many * values are returned. */ - if (ret_num != ds->ds_num) + if (ret_num != (size_t) ds->ds_num) { ERROR ("utils_cache: uc_get_rate: ds[%s] has %i values, " "but uc_get_rate_by_name returned %zu.",