[libvirt PATCH 4/6] virDomainSEVDefParseXML: Use automatic memory management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index dda615a8ba..dd803e6df5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14719,7 +14719,7 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
                         xmlXPathContextPtr ctxt)
 {
     VIR_XPATH_NODE_AUTORESTORE(ctxt)
-    virDomainSEVDef *def;
+    g_autoptr(virDomainSEVDef) def = NULL;
     unsigned long policy;
     int rc = -1;
 
@@ -14765,10 +14765,9 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
     def->dh_cert = virXPathString("string(./dhCert)", ctxt);
     def->session = virXPathString("string(./session)", ctxt);
 
-    return def;
+    return g_steal_pointer(&def);
 
  error:
-    virDomainSEVDefFree(def);
     return NULL;
 }
 
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux