mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: domain_conf: cleanup def in case of errors
Just like in rest of the function virDomainFSDefParseXML, use goto error so that def will be cleaned up in error cases. Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
6fa82fd8e2
commit
9ef6fee129
@ -8866,23 +8866,23 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt,
|
||||
goto error;
|
||||
|
||||
if ((n = virXPathNodeSet("./idmap/uid", ctxt, &uid_nodes)) < 0)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
if (n) {
|
||||
def->idmap.uidmap = virDomainIdmapDefParseXML(ctxt, uid_nodes, n);
|
||||
if (!def->idmap.uidmap)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
def->idmap.nuidmap = n;
|
||||
}
|
||||
|
||||
if ((n = virXPathNodeSet("./idmap/gid", ctxt, &gid_nodes)) < 0)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
if (n) {
|
||||
def->idmap.gidmap = virDomainIdmapDefParseXML(ctxt, gid_nodes, n);
|
||||
if (!def->idmap.gidmap)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
def->idmap.ngidmap = n;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user