From: Florian Forster Date: Fri, 19 Jan 2024 20:13:17 +0000 (+0100) Subject: cpu plugi: Consistently set the `finalized` field at the end of the function. X-Git-Tag: 6.0.0-rc0~5^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98981a541ed52eab60d60b6c607994cbadfd3aa1;p=thirdparty%2Fcollectd.git cpu plugi: Consistently set the `finalized` field at the end of the function. --- diff --git a/src/cpu.c b/src/cpu.c index 74cd98637..b07d87c75 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -364,7 +364,6 @@ static int usage_init(usage_t *u, cdtime_t now) { } u->time = now; u->cpu_num = 0; - u->finalized = false; for (size_t i = 0; i < u->states_num; i++) { u->states[i].rate = 0; u->states[i].has_rate = false; @@ -374,6 +373,7 @@ static int usage_init(usage_t *u, cdtime_t now) { u->global[s].has_rate = false; } + u->finalized = false; return 0; }