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