Fix unitialized variable in coverage_log()
authorJustin Pettit <jpettit@nicira.com>
Tue, 14 Jul 2009 07:25:44 +0000 (00:25 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 14 Jul 2009 07:25:44 +0000 (00:25 -0700)
When providing the ability to force coverage printouts to occur, some
code was moved around that allowed the "hash" variable to be used
unitialized.  This fixes that.

Thanks to Ben for pointing out the problem.

Bug #1577

lib/coverage.c

index 6f805e9eacd44b2c9be0fe825708d5629e55bcc7..ba5d68d84751512e69063e4fc31361f388e9fe48 100644 (file)
@@ -134,8 +134,8 @@ coverage_log(enum vlog_level level, bool suppress_dups)
         return;
     }
 
+    hash = coverage_hash();
     if (suppress_dups) {
-        hash = coverage_hash();
         if (coverage_hit(hash)) {
             VLOG(level, "Skipping details of duplicate event coverage for "
                  "hash=%08"PRIx32" in epoch %u", hash, epoch);