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: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6393%2Fhead;p=thirdparty%2Fpdns.git 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 d3b14e2c6d..93fd8ff242 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; {