Re: [PATCH v2 2/3] Add test case for virHashEqual function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/24/2012 06:19 AM, Michal Privoznik wrote:

Therefore I am pushing this under trivial and build-breaker rules (yeah,
one thing - and perhaps the only one - i like about 4.6 gcc is enhanced
static analysis as I spotted warning while compiling current HEAD):

Author: Michal Privoznik<mprivozn@xxxxxxxxxx>
Date:   Tue Jan 24 12:09:42 2012 +0100

     hashtest: Initialize variable in virHashEqual test

     One of latest patches (b7bcb22ce2) enhanced testing for virHashEqual.
     However, hash2 variable might be used uninitialized.

diff --git a/tests/hashtest.c b/tests/hashtest.c
index 6c45b01..441672c 100644
--- a/tests/hashtest.c
+++ b/tests/hashtest.c
@@ -583,7 +583,7 @@ testHashEqualCompValue(const void *value1, const
void *value2)
  static int
  testHashEqual(const void *data ATTRIBUTE_UNUSED)
  {
-    virHashTablePtr hash1, hash2;
+    virHashTablePtr hash1, hash2 = NULL;
      int ret = -1;
      char keya[] = "a";
      char keyb[] = "b";

ACK.


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]