qemu: virConnectGetVersion returns bogus value

The unitialized local variable qemuVersion can cause an random value
to be returned for the hypervisor version, observable with virsh version.
Introduced by commit b46f7f4a0b

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
Viktor Mihajlovski 2013-02-28 11:11:17 +01:00 committed by Peter Krempa
parent 0a562de1ff
commit adfa3469bb

View File

@ -1382,7 +1382,7 @@ cleanup:
static int qemuGetVersion(virConnectPtr conn, unsigned long *version) { static int qemuGetVersion(virConnectPtr conn, unsigned long *version) {
virQEMUDriverPtr driver = conn->privateData; virQEMUDriverPtr driver = conn->privateData;
int ret = -1; int ret = -1;
unsigned int qemuVersion; unsigned int qemuVersion = 0;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
if (!(caps = virQEMUDriverGetCapabilities(driver, false))) if (!(caps = virQEMUDriverGetCapabilities(driver, false)))