]> granicus.if.org Git - pdns/commitdiff
dnsdist: Work around a false positive in statNodeRespRing()
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 26 Mar 2018 15:25:29 +0000 (17:25 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 26 Mar 2018 15:25:29 +0000 (17:25 +0200)
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.

pdns/dnsdist-lua-inspection.cc

index d3b14e2c6d1af01f98f5310e800554c09f213a24..93fd8ff242d9629c82b5b9b7590ec7768fa47131 100644 (file)
@@ -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;
   {