From: Remi Gacogne Date: Mon, 26 Mar 2018 15:25:29 +0000 (+0200) Subject: dnsdist: Work around a false positive in statNodeRespRing() X-Git-Tag: dnsdist-1.3.0~25^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ff8246f59f86a068ce7daf8881aabc1aecef379;p=pdns dnsdist: Work around a false positive in statNodeRespRing() Debian Jessie's compiler reports that `cutoff` might be used uninitialized in `statNodeRespRing()`. This is a false positive, but let's just initialize it no matter what so the compiler stops whining. --- diff --git a/pdns/dnsdist-lua-inspection.cc b/pdns/dnsdist-lua-inspection.cc index d3b14e2c6..93fd8ff24 100644 --- a/pdns/dnsdist-lua-inspection.cc +++ b/pdns/dnsdist-lua-inspection.cc @@ -99,10 +99,8 @@ static void statNodeRespRing(statvisitor_t visitor, unsigned int seconds) { struct timespec cutoff, now; gettime(&now); - if (seconds) { - cutoff = now; - cutoff.tv_sec -= seconds; - } + cutoff = now; + cutoff.tv_sec -= seconds; StatNode root; {