Merge branch 'collectd-4.7'
[collectd.git] / src / utils_cache.c
index 5e62aa4..d4ffe10 100644 (file)
@@ -345,6 +345,7 @@ int uc_check_timeout (void)
       sfree (keys[i]);
       sfree (key);
       cache_free (ce);
+      continue;
     }
 
     /* If we get here, the value is ``interesting''. Query the record from the
@@ -389,6 +390,10 @@ int uc_check_timeout (void)
          keys[i], status);
       sfree (keys[i]);
     }
+
+    /* Make really sure the next iteration doesn't work with this pointer.
+     * There have been too many bugs in the past.. :/  -- octo */
+    ce = NULL;
   } /* for (keys[i]) */
 
   c_avl_iterator_destroy (iter);