1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

conf,util,qemu: Use VIR_STEAL_PTR for authdef processing

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
John Ferlan 2019-02-07 07:44:45 -05:00
parent b4a4e8f71a
commit a98d9daf07
4 changed files with 4 additions and 8 deletions

View File

@ -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;
}

View File

@ -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) */

View File

@ -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.

View File

@ -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.