提交 8267aea5 编写于 作者: E Eric Blake

qemu: fix blkio memory leak on failure

Leak detected by Coverity, and introduced in commit 93ab5859.
Reported by Alex Jia.

* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Free
devices array on error.
上级 bc1b27e0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册