]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: replace VIR_FREE with g_free in any ESX_VI__TEMPLATE__FREE
authorLaine Stump <laine@redhat.com>
Fri, 5 Feb 2021 05:46:24 +0000 (00:46 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 12 Feb 2021 17:10:38 +0000 (12:10 -0500)
Invocations of the macro ESX_VI__TEMPLATE__FREE() will free the main
object (referenced as "item") that's pointing to all the things being
VIR_FREEd in the body, so it is safe for all the pointers in item to
just be g_freed rather that VIR_FREEd.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/esx/esx_vi.c
src/esx/esx_vi_types.c

index 7e05318fdc97a9fa721197fc3f47a24e25a7a7b6..2eb804885890a070da2c345bed2b0aae8ce9bc6d 100644 (file)
@@ -805,19 +805,19 @@ ESX_VI__TEMPLATE__FREE(Context,
         virMutexDestroy(item->sessionLock);
 
     esxVI_CURL_Free(&item->curl);
-    VIR_FREE(item->url);
-    VIR_FREE(item->ipAddress);
-    VIR_FREE(item->username);
-    VIR_FREE(item->password);
+    g_free(item->url);
+    g_free(item->ipAddress);
+    g_free(item->username);
+    g_free(item->password);
     esxVI_ServiceContent_Free(&item->service);
     esxVI_UserSession_Free(&item->session);
-    VIR_FREE(item->sessionLock);
+    g_free(item->sessionLock);
     esxVI_Datacenter_Free(&item->datacenter);
-    VIR_FREE(item->datacenterPath);
+    g_free(item->datacenterPath);
     esxVI_ComputeResource_Free(&item->computeResource);
-    VIR_FREE(item->computeResourcePath);
+    g_free(item->computeResourcePath);
     esxVI_HostSystem_Free(&item->hostSystem);
-    VIR_FREE(item->hostSystemName);
+    g_free(item->hostSystemName);
     esxVI_SelectionSpec_Free(&item->selectSet_folderToChildEntity);
     esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToParent);
     esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToVm);
@@ -1419,7 +1419,7 @@ ESX_VI__TEMPLATE__ALLOC(Response)
 /* esxVI_Response_Free */
 ESX_VI__TEMPLATE__FREE(Response,
 {
-    VIR_FREE(item->content);
+    g_free(item->content);
 
     xmlFreeDoc(item->document);
 })
index 6821587e447c1da06271cb9e7fc896eb8552e3cb..4d3617e0a8a1d22ac9d623a7b935ca85e790817d 100644 (file)
@@ -900,8 +900,8 @@ ESX_VI__TEMPLATE__ALLOC(AnyType)
 ESX_VI__TEMPLATE__FREE(AnyType,
 {
     xmlFreeNode(item->node);
-    VIR_FREE(item->other);
-    VIR_FREE(item->value);
+    g_free(item->other);
+    g_free(item->value);
 })
 
 const char *
@@ -1117,7 +1117,7 @@ ESX_VI__TEMPLATE__FREE(String,
 {
     esxVI_String_Free(&item->_next);
 
-    VIR_FREE(item->value);
+    g_free(item->value);
 })
 
 /* esxVI_String_Validate */
@@ -1421,7 +1421,7 @@ ESX_VI__TEMPLATE__ALLOC(DateTime)
 /* esxVI_DateTime_Free */
 ESX_VI__TEMPLATE__FREE(DateTime,
 {
-    VIR_FREE(item->value);
+    g_free(item->value);
 })
 
 /* esxVI_DateTime_Validate */
@@ -1564,8 +1564,8 @@ ESX_VI__TEMPLATE__ALLOC(Fault);
 /* esxVI_Fault_Free */
 ESX_VI__TEMPLATE__FREE(Fault,
 {
-    VIR_FREE(item->faultcode);
-    VIR_FREE(item->faultstring);
+    g_free(item->faultcode);
+    g_free(item->faultstring);
 })
 
 /* esxVI_Fault_Validate */
@@ -1595,7 +1595,7 @@ ESX_VI__TEMPLATE__ALLOC(MethodFault);
 /* esxVI_MethodFault_Free */
 ESX_VI__TEMPLATE__FREE(MethodFault,
 {
-    VIR_FREE(item->_actualType);
+    g_free(item->_actualType);
 })
 
 int
@@ -1638,8 +1638,8 @@ ESX_VI__TEMPLATE__FREE(ManagedObjectReference,
 {
     esxVI_ManagedObjectReference_Free(&item->_next);
 
-    VIR_FREE(item->type);
-    VIR_FREE(item->value);
+    g_free(item->type);
+    g_free(item->value);
 })
 
 /* esxVI_ManagedObjectReference_DeepCopy */
@@ -1732,17 +1732,17 @@ ESX_VI__TEMPLATE__ALLOC(Event)
 ESX_VI__TEMPLATE__FREE(Event,
 {
     esxVI_Event_Free(&item->_next);
-    VIR_FREE(item->_actualType);
+    g_free(item->_actualType);
 
     esxVI_Int_Free(&item->key);
     esxVI_Int_Free(&item->chainId);
     esxVI_DateTime_Free(&item->createdTime);
-    VIR_FREE(item->userName);
+    g_free(item->userName);
     /* FIXME: datacenter is currently ignored */
     /* FIXME: computeResource is currently ignored */
     /* FIXME: host is currently ignored */
     esxVI_VmEventArgument_Free(&item->vm);
-    VIR_FREE(item->fullFormattedMessage);
+    g_free(item->fullFormattedMessage);
 })
 
 /* esxVI_Event_Validate */