提交 a03f5cdd 编写于 作者: W w00251574 提交者: Michal Privoznik

qemu: Fix memory leak in qemuDomainBlockJobSetSpeed()

fix 'device' leak in qemuDomainBlockJobSetSpeed

Signed-off-by: Jie Wang <wangjie88.huawei.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 d63f1c6a
...@@ -17347,7 +17347,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, ...@@ -17347,7 +17347,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
int ret = -1; int ret = -1;
virDomainObjPtr vm; virDomainObjPtr vm;
const char *device; char *device = NULL;
unsigned long long speed = bandwidth; unsigned long long speed = bandwidth;
virCheckFlags(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES, -1); virCheckFlags(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES, -1);
...@@ -17395,6 +17395,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, ...@@ -17395,6 +17395,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
qemuDomainObjEndJob(driver, vm); qemuDomainObjEndJob(driver, vm);
cleanup: cleanup:
VIR_FREE(device);
virDomainObjEndAPI(&vm); virDomainObjEndAPI(&vm);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册