]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: fix build with clang
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sun, 26 Mar 2017 04:29:49 +0000 (08:29 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Sun, 26 Mar 2017 04:43:36 +0000 (08:43 +0400)
qemuMigrationResetTLS() does not initialize 'ret' by default,
so when it jumps to 'cleanup' on error, the 'ret' variable will be
uninitialized, which clang complains about.

Set it to '-1' by default.

src/qemu/qemu_migration.c

index d91279ec6f4510949165aba0ce851adbe7e119d3..a69e8784ab5240c947bc8f6ff631bcca7bc703bd 100644 (file)
@@ -3815,7 +3815,7 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver,
     char *tlsAlias = in_tlsAlias;
     char *secAlias = in_secAlias;
     qemuMonitorMigrationParams migParams = { 0 };
-    int ret;
+    int ret = -1;
 
     /* If coming from a path that doesn't know whether it's been used or not,
      * let's first check we need to do this. If the tls-creds doesn't exist