mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +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…
x
Reference in New Issue
Block a user