1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-06 17:17:56 +03:00

esx: replace VIR_FREE with g_free in any ESX_VI__TEMPLATE__FREE

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>
This commit is contained in:
Laine Stump 2021-02-05 00:46:24 -05:00
parent 859f7e2072
commit e5339e38ca
2 changed files with 21 additions and 21 deletions

View File

@ -805,19 +805,19 @@ ESX_VI__TEMPLATE__FREE(Context,
virMutexDestroy(item->sessionLock); virMutexDestroy(item->sessionLock);
esxVI_CURL_Free(&item->curl); esxVI_CURL_Free(&item->curl);
VIR_FREE(item->url); g_free(item->url);
VIR_FREE(item->ipAddress); g_free(item->ipAddress);
VIR_FREE(item->username); g_free(item->username);
VIR_FREE(item->password); g_free(item->password);
esxVI_ServiceContent_Free(&item->service); esxVI_ServiceContent_Free(&item->service);
esxVI_UserSession_Free(&item->session); esxVI_UserSession_Free(&item->session);
VIR_FREE(item->sessionLock); g_free(item->sessionLock);
esxVI_Datacenter_Free(&item->datacenter); esxVI_Datacenter_Free(&item->datacenter);
VIR_FREE(item->datacenterPath); g_free(item->datacenterPath);
esxVI_ComputeResource_Free(&item->computeResource); esxVI_ComputeResource_Free(&item->computeResource);
VIR_FREE(item->computeResourcePath); g_free(item->computeResourcePath);
esxVI_HostSystem_Free(&item->hostSystem); esxVI_HostSystem_Free(&item->hostSystem);
VIR_FREE(item->hostSystemName); g_free(item->hostSystemName);
esxVI_SelectionSpec_Free(&item->selectSet_folderToChildEntity); esxVI_SelectionSpec_Free(&item->selectSet_folderToChildEntity);
esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToParent); esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToParent);
esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToVm); esxVI_SelectionSpec_Free(&item->selectSet_hostSystemToVm);
@ -1419,7 +1419,7 @@ ESX_VI__TEMPLATE__ALLOC(Response)
/* esxVI_Response_Free */ /* esxVI_Response_Free */
ESX_VI__TEMPLATE__FREE(Response, ESX_VI__TEMPLATE__FREE(Response,
{ {
VIR_FREE(item->content); g_free(item->content);
xmlFreeDoc(item->document); xmlFreeDoc(item->document);
}) })

View File

@ -900,8 +900,8 @@ ESX_VI__TEMPLATE__ALLOC(AnyType)
ESX_VI__TEMPLATE__FREE(AnyType, ESX_VI__TEMPLATE__FREE(AnyType,
{ {
xmlFreeNode(item->node); xmlFreeNode(item->node);
VIR_FREE(item->other); g_free(item->other);
VIR_FREE(item->value); g_free(item->value);
}) })
const char * const char *
@ -1117,7 +1117,7 @@ ESX_VI__TEMPLATE__FREE(String,
{ {
esxVI_String_Free(&item->_next); esxVI_String_Free(&item->_next);
VIR_FREE(item->value); g_free(item->value);
}) })
/* esxVI_String_Validate */ /* esxVI_String_Validate */
@ -1421,7 +1421,7 @@ ESX_VI__TEMPLATE__ALLOC(DateTime)
/* esxVI_DateTime_Free */ /* esxVI_DateTime_Free */
ESX_VI__TEMPLATE__FREE(DateTime, ESX_VI__TEMPLATE__FREE(DateTime,
{ {
VIR_FREE(item->value); g_free(item->value);
}) })
/* esxVI_DateTime_Validate */ /* esxVI_DateTime_Validate */
@ -1564,8 +1564,8 @@ ESX_VI__TEMPLATE__ALLOC(Fault);
/* esxVI_Fault_Free */ /* esxVI_Fault_Free */
ESX_VI__TEMPLATE__FREE(Fault, ESX_VI__TEMPLATE__FREE(Fault,
{ {
VIR_FREE(item->faultcode); g_free(item->faultcode);
VIR_FREE(item->faultstring); g_free(item->faultstring);
}) })
/* esxVI_Fault_Validate */ /* esxVI_Fault_Validate */
@ -1595,7 +1595,7 @@ ESX_VI__TEMPLATE__ALLOC(MethodFault);
/* esxVI_MethodFault_Free */ /* esxVI_MethodFault_Free */
ESX_VI__TEMPLATE__FREE(MethodFault, ESX_VI__TEMPLATE__FREE(MethodFault,
{ {
VIR_FREE(item->_actualType); g_free(item->_actualType);
}) })
int int
@ -1638,8 +1638,8 @@ ESX_VI__TEMPLATE__FREE(ManagedObjectReference,
{ {
esxVI_ManagedObjectReference_Free(&item->_next); esxVI_ManagedObjectReference_Free(&item->_next);
VIR_FREE(item->type); g_free(item->type);
VIR_FREE(item->value); g_free(item->value);
}) })
/* esxVI_ManagedObjectReference_DeepCopy */ /* esxVI_ManagedObjectReference_DeepCopy */
@ -1732,17 +1732,17 @@ ESX_VI__TEMPLATE__ALLOC(Event)
ESX_VI__TEMPLATE__FREE(Event, ESX_VI__TEMPLATE__FREE(Event,
{ {
esxVI_Event_Free(&item->_next); esxVI_Event_Free(&item->_next);
VIR_FREE(item->_actualType); g_free(item->_actualType);
esxVI_Int_Free(&item->key); esxVI_Int_Free(&item->key);
esxVI_Int_Free(&item->chainId); esxVI_Int_Free(&item->chainId);
esxVI_DateTime_Free(&item->createdTime); esxVI_DateTime_Free(&item->createdTime);
VIR_FREE(item->userName); g_free(item->userName);
/* FIXME: datacenter is currently ignored */ /* FIXME: datacenter is currently ignored */
/* FIXME: computeResource is currently ignored */ /* FIXME: computeResource is currently ignored */
/* FIXME: host is currently ignored */ /* FIXME: host is currently ignored */
esxVI_VmEventArgument_Free(&item->vm); esxVI_VmEventArgument_Free(&item->vm);
VIR_FREE(item->fullFormattedMessage); g_free(item->fullFormattedMessage);
}) })
/* esxVI_Event_Validate */ /* esxVI_Event_Validate */