virDomainIOThreadIDDefParseXML: Refactor cleanup
Automatically free 'iothrid' and remove all the cleanup cruft. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
129f9b8f4a
commit
351f2b10de
@ -17010,21 +17010,14 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
static virDomainIOThreadIDDef *
|
static virDomainIOThreadIDDef *
|
||||||
virDomainIOThreadIDDefParseXML(xmlNodePtr node)
|
virDomainIOThreadIDDefParseXML(xmlNodePtr node)
|
||||||
{
|
{
|
||||||
virDomainIOThreadIDDef *iothrid;
|
g_autoptr(virDomainIOThreadIDDef) iothrid = g_new0(virDomainIOThreadIDDef, 1);
|
||||||
|
|
||||||
iothrid = g_new0(virDomainIOThreadIDDef, 1);
|
|
||||||
|
|
||||||
if (virXMLPropUInt(node, "id", 10,
|
if (virXMLPropUInt(node, "id", 10,
|
||||||
VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
|
VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
|
||||||
&iothrid->iothread_id) < 0)
|
&iothrid->iothread_id) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
|
|
||||||
return iothrid;
|
return g_steal_pointer(&iothrid);
|
||||||
|
|
||||||
error:
|
|
||||||
virDomainIOThreadIDDefFree(iothrid);
|
|
||||||
iothrid = NULL;
|
|
||||||
return iothrid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user