Merge branch 'collectd-4.4' into collectd-4.5
[collectd.git] / src / utils_cache.c
index 241aa72..824b7c8 100644 (file)
@@ -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);
       }