[libvirt] [PATCH] test: ensure nerrors variable is initialized

Daniel P. Berrangé posted 1 patch 4 years, 9 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190704132357.22817-1-berrange@redhat.com
src/test/test_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] test: ensure nerrors variable is initialized
Posted by Daniel P. Berrangé 4 years, 9 months ago
There is an error path that jumps over the initialization of
nerrors, and the jump target reads the variable contents.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Pushed as a build fix

 src/test/test_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index ce4ff1a582..2371581f51 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3275,7 +3275,7 @@ static int testDomainGetDiskErrors(virDomainPtr dom,
     virDomainObjPtr vm = NULL;
     int ret = -1;
     size_t i;
-    size_t nerrors;
+    size_t nerrors = 0;
 
     virCheckFlags(0, -1);
 
-- 
2.21.0

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