mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
virDomainSEVDefParseXML: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
42c0c7275d
commit
6cc25a6bc6
@ -14719,7 +14719,7 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
|
|||||||
xmlXPathContextPtr ctxt)
|
xmlXPathContextPtr ctxt)
|
||||||
{
|
{
|
||||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||||
virDomainSEVDef *def;
|
g_autoptr(virDomainSEVDef) def = NULL;
|
||||||
unsigned long policy;
|
unsigned long policy;
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
@ -14765,10 +14765,9 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
|
|||||||
def->dh_cert = virXPathString("string(./dhCert)", ctxt);
|
def->dh_cert = virXPathString("string(./dhCert)", ctxt);
|
||||||
def->session = virXPathString("string(./session)", ctxt);
|
def->session = virXPathString("string(./session)", ctxt);
|
||||||
|
|
||||||
return def;
|
return g_steal_pointer(&def);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDomainSEVDefFree(def);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user