[libvirt PATCH 05/16] test driver: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

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

 



Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/test/test_driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 24ff6e8967..641a141b6a 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -5561,7 +5561,7 @@ testNetworkCreateXMLFlags(virConnectPtr conn, const char *xml,
                           unsigned int flags)
 {
     testDriver *privconn = conn->privateData;
-    virNetworkDef *newDef;
+    g_autoptr(virNetworkDef) newDef = NULL;
     virNetworkObj *obj = NULL;
     virNetworkDef *def;
     virNetworkPtr net = NULL;
@@ -5588,7 +5588,6 @@ testNetworkCreateXMLFlags(virConnectPtr conn, const char *xml,
     net = virGetNetwork(conn, def->name, def->uuid);
 
  cleanup:
-    virNetworkDefFree(newDef);
     virObjectEventStateQueue(privconn->eventState, event);
     virNetworkObjEndAPI(&obj);
     return net;
@@ -5608,7 +5607,7 @@ testNetworkDefineXMLFlags(virConnectPtr conn,
                           unsigned int flags)
 {
     testDriver *privconn = conn->privateData;
-    virNetworkDef *newDef;
+    g_autoptr(virNetworkDef) newDef = NULL;
     virNetworkObj *obj = NULL;
     virNetworkDef *def;
     virNetworkPtr net = NULL;
@@ -5632,7 +5631,6 @@ testNetworkDefineXMLFlags(virConnectPtr conn,
     net = virGetNetwork(conn, def->name, def->uuid);
 
  cleanup:
-    virNetworkDefFree(newDef);
     virObjectEventStateQueue(privconn->eventState, event);
     virNetworkObjEndAPI(&obj);
     return net;
-- 
2.37.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