From: Florian Forster Date: Fri, 19 Jun 2015 08:54:02 +0000 (+0200) Subject: rrdtool plugin: Add assertion. X-Git-Tag: collectd-5.5.1~68^2~25 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=903a58aa61577c6cab6614bd9b25a8d005cee3f7;p=collectd.git rrdtool plugin: Add assertion. This helps the static code analysis to figure out that memory is not leaking after all. --- diff --git a/src/rrdtool.c b/src/rrdtool.c index bebf468c..8497a24c 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -743,6 +743,7 @@ static int rrd_cache_insert (const char *filename, new_rc = 1; } + assert (value_time > 0); /* plugin_dispatch() ensures this. */ if (rc->last_value >= value_time) { pthread_mutex_unlock (&cache_lock);