mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 12:25:52 +00:00
qemu: fix blkio memory leak on failure
Leak detected by Coverity, and introduced in commit 93ab585
.
Reported by Alex Jia.
* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Free
devices array on error.
This commit is contained in:
parent
bc1b27e07e
commit
8267aea5a6
@ -6012,11 +6012,8 @@ static int qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j != ndevices) {
|
||||
ret = -1;
|
||||
continue;
|
||||
}
|
||||
if (qemuDomainMergeDeviceWeights(&vm->def->blkio.devices,
|
||||
if (j != ndevices ||
|
||||
qemuDomainMergeDeviceWeights(&vm->def->blkio.devices,
|
||||
&vm->def->blkio.ndevices,
|
||||
devices, ndevices) < 0)
|
||||
ret = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user