[libvirt PATCH 02/16] esx: 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/esx/esx_network_driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c
index 290c0ad56f..bf9630ce9d 100644
--- a/src/esx/esx_network_driver.c
+++ b/src/esx/esx_network_driver.c
@@ -277,7 +277,7 @@ esxNetworkDefineXMLFlags(virConnectPtr conn, const char *xml,
 {
     virNetworkPtr network = NULL;
     esxPrivate *priv = conn->privateData;
-    virNetworkDef *def = NULL;
+    g_autoptr(virNetworkDef) def = NULL;
     esxVI_HostVirtualSwitch *hostVirtualSwitch = NULL;
     esxVI_HostPortGroup *hostPortGroupList = NULL;
     esxVI_HostPortGroup *hostPortGroup = NULL;
@@ -483,7 +483,6 @@ esxNetworkDefineXMLFlags(virConnectPtr conn, const char *xml,
     network = virGetNetwork(conn, hostVirtualSwitch->name, md5);
 
  cleanup:
-    virNetworkDefFree(def);
     esxVI_HostVirtualSwitch_Free(&hostVirtualSwitch);
     esxVI_HostPortGroup_Free(&hostPortGroupList);
     esxVI_HostVirtualSwitchSpec_Free(&hostVirtualSwitchSpec);
@@ -658,7 +657,7 @@ esxNetworkGetXMLDesc(virNetworkPtr network_, unsigned int flags)
     esxVI_String *networkNameList = NULL;
     esxVI_String *hostPortGroupKey = NULL;
     esxVI_String *networkName = NULL;
-    virNetworkDef *def;
+    g_autoptr(virNetworkDef) def = NULL;
 
     if (esxVI_EnsureSession(priv->primary) < 0)
         return NULL;
@@ -812,7 +811,6 @@ esxNetworkGetXMLDesc(virNetworkPtr network_, unsigned int flags)
     esxVI_String_Free(&propertyNameList);
     esxVI_ObjectContent_Free(&networkList);
     esxVI_String_Free(&networkNameList);
-    virNetworkDefFree(def);
 
     return xml;
 }
-- 
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