提交 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,
authdef->secrettype);
goto cleanup;
}
iscsisrc->src->auth = authdef;
authdef = NULL;
VIR_STEAL_PTR(iscsisrc->src->auth, authdef);
}
cur = cur->next;
}
......
......@@ -584,8 +584,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
goto cleanup;
}
source->auth = authdef;
authdef = NULL;
VIR_STEAL_PTR(source->auth, authdef);
}
/* Option protocol version string (NFSvN) */
......
......@@ -133,8 +133,7 @@ qemuParseDriveURIString(virDomainDiskDefPtr def, virURIPtr uri,
if (VIR_STRDUP(authdef->secrettype, secrettype) < 0)
goto error;
}
def->src->auth = authdef;
authdef = NULL;
VIR_STEAL_PTR(def->src->auth, authdef);
/* Cannot formulate a secretType (eg, usage or uuid) given
* what is provided.
......
......@@ -2895,9 +2895,8 @@ virStorageSourceParseRBDColonString(const char *rbdstr,
if (VIR_STRDUP(authdef->secrettype,
virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_CEPH)) < 0)
goto error;
src->auth = authdef;
VIR_STEAL_PTR(src->auth, authdef);
src->authInherited = true;
authdef = NULL;
/* Cannot formulate a secretType (eg, usage or uuid) given
* what is provided.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册