]> xenbits.xensource.com Git - libvirt.git/commitdiff
hashtest: Initialize variable in virHashEqual test
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 24 Jan 2012 11:09:42 +0000 (12:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 24 Jan 2012 11:09:42 +0000 (12:09 +0100)
One of latest patches (b7bcb22ce2) enhanced testing for virHashEqual.
However, hash2 variable might be used uninitialized.

tests/hashtest.c

index 6c45b01c61ced6ff6281a7332472d700dcaed463..441672c60bccbc6bce67211bd29ef26483c7df3e 100644 (file)
@@ -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";