提交 4415b11d 编写于 作者: P Peter Krempa

qemuBlockStorageSourceDetachPrepare: Get rid of cleanup section

Use g_new0 to completely avoid the 'cleanup' label.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 4653a519
...@@ -1734,10 +1734,8 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src, ...@@ -1734,10 +1734,8 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src,
{ {
qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
qemuBlockStorageSourceAttachDataPtr ret = NULL;
if (VIR_ALLOC(data) < 0) data = g_new0(qemuBlockStorageSourceAttachData, 1);
goto cleanup;
if (driveAlias) { if (driveAlias) {
data->driveAlias = g_steal_pointer(&driveAlias); data->driveAlias = g_steal_pointer(&driveAlias);
...@@ -1771,11 +1769,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src, ...@@ -1771,11 +1769,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src,
data->encryptsecretAlias = g_strdup(srcpriv->encinfo->s.aes.alias); data->encryptsecretAlias = g_strdup(srcpriv->encinfo->s.aes.alias);
} }
ret = g_steal_pointer(&data); return g_steal_pointer(&data);
cleanup:
VIR_FREE(driveAlias);
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册