提交 a98d9daf 编写于 作者: J John Ferlan

conf,util,qemu: Use VIR_STEAL_PTR for authdef processing

Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 b4a4e8f7
...@@ -7632,8 +7632,7 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode, ...@@ -7632,8 +7632,7 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode,
authdef->secrettype); authdef->secrettype);
goto cleanup; goto cleanup;
} }
iscsisrc->src->auth = authdef; VIR_STEAL_PTR(iscsisrc->src->auth, authdef);
authdef = NULL;
} }
cur = cur->next; cur = cur->next;
} }
......
...@@ -584,8 +584,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, ...@@ -584,8 +584,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
goto cleanup; goto cleanup;
} }
source->auth = authdef; VIR_STEAL_PTR(source->auth, authdef);
authdef = NULL;
} }
/* Option protocol version string (NFSvN) */ /* Option protocol version string (NFSvN) */
......
...@@ -133,8 +133,7 @@ qemuParseDriveURIString(virDomainDiskDefPtr def, virURIPtr uri, ...@@ -133,8 +133,7 @@ qemuParseDriveURIString(virDomainDiskDefPtr def, virURIPtr uri,
if (VIR_STRDUP(authdef->secrettype, secrettype) < 0) if (VIR_STRDUP(authdef->secrettype, secrettype) < 0)
goto error; goto error;
} }
def->src->auth = authdef; VIR_STEAL_PTR(def->src->auth, authdef);
authdef = NULL;
/* Cannot formulate a secretType (eg, usage or uuid) given /* Cannot formulate a secretType (eg, usage or uuid) given
* what is provided. * what is provided.
......
...@@ -2895,9 +2895,8 @@ virStorageSourceParseRBDColonString(const char *rbdstr, ...@@ -2895,9 +2895,8 @@ virStorageSourceParseRBDColonString(const char *rbdstr,
if (VIR_STRDUP(authdef->secrettype, if (VIR_STRDUP(authdef->secrettype,
virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_CEPH)) < 0) virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_CEPH)) < 0)
goto error; goto error;
src->auth = authdef; VIR_STEAL_PTR(src->auth, authdef);
src->authInherited = true; src->authInherited = true;
authdef = NULL;
/* Cannot formulate a secretType (eg, usage or uuid) given /* Cannot formulate a secretType (eg, usage or uuid) given
* what is provided. * what is provided.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册