From: Florian Forster Date: Wed, 8 Jul 2009 08:51:28 +0000 (+0200) Subject: src/utils_cache.c: uc_check_timeout: Don't free a `ce' from the previous iteration. X-Git-Tag: collectd-4.6.4~4 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=984f37cb1a5813d2a089129ebf906a9963b6f7c8 src/utils_cache.c: uc_check_timeout: Don't free a `ce' from the previous iteration. This may habe been a cause of the reported assertion failure, too. --- diff --git a/src/utils_cache.c b/src/utils_cache.c index 2f70ffe8..7b584c5c 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -304,7 +304,6 @@ int uc_check_timeout (void) } sfree (keys[i]); sfree (key); - cache_free (ce); continue; } @@ -350,6 +349,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);