]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: ensure nerrors variable is initialized
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 4 Jul 2019 13:20:35 +0000 (14:20 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 4 Jul 2019 13:20:35 +0000 (14:20 +0100)
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>
src/test/test_driver.c

index ce4ff1a5822e72cd9e64da77013fcb3a21474d96..2371581f5117778500032a849b33a5b8b7a0b756 100644 (file)
@@ -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);