提交 82b3f470 编写于 作者: P Peter Krempa

qemu: Modernize memory cleaning in qemuDomainBlockPullCommon

Use VIR_AUTOFREE and VIR_AUTOUNREF.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 ddafae7a
...@@ -17136,13 +17136,13 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver, ...@@ -17136,13 +17136,13 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver,
unsigned int flags) unsigned int flags)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
char *device = NULL; VIR_AUTOFREE(char *) device = NULL;
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
virStorageSourcePtr baseSource = NULL; virStorageSourcePtr baseSource = NULL;
unsigned int baseIndex = 0; unsigned int baseIndex = 0;
char *basePath = NULL; VIR_AUTOFREE(char *) basePath = NULL;
char *backingPath = NULL; VIR_AUTOFREE(char *) backingPath = NULL;
unsigned long long speed = bandwidth; unsigned long long speed = bandwidth;
qemuBlockJobDataPtr job = NULL; qemuBlockJobDataPtr job = NULL;
int ret = -1; int ret = -1;
...@@ -17235,10 +17235,6 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver, ...@@ -17235,10 +17235,6 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver,
cleanup: cleanup:
qemuBlockJobStartupFinalize(job); qemuBlockJobStartupFinalize(job);
virObjectUnref(cfg);
VIR_FREE(basePath);
VIR_FREE(backingPath);
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.
先完成此消息的编辑!
想要评论请 注册