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

util: replace VIR_FREE with g_free in all vir*Free() functions

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Laine Stump 2021-02-03 14:32:34 -05:00
parent a3a88167e4
commit 238d96b8f1
41 changed files with 225 additions and 225 deletions

View File

@ -172,9 +172,9 @@ virArpTableFree(virArpTablePtr table)
return;
for (i = 0; i < table->n; i++) {
VIR_FREE(table->t[i].ipaddr);
VIR_FREE(table->t[i].mac);
g_free(table->t[i].ipaddr);
g_free(table->t[i].mac);
}
VIR_FREE(table->t);
VIR_FREE(table);
g_free(table->t);
g_free(table);
}

View File

@ -88,8 +88,8 @@ void virAuthConfigFree(virAuthConfigPtr auth)
return;
g_key_file_free(auth->keyfile);
VIR_FREE(auth->path);
VIR_FREE(auth);
g_free(auth->path);
g_free(auth);
}

View File

@ -94,8 +94,8 @@ void
virBitmapFree(virBitmapPtr bitmap)
{
if (bitmap) {
VIR_FREE(bitmap->map);
VIR_FREE(bitmap);
g_free(bitmap->map);
g_free(bitmap);
}
}

View File

@ -3581,15 +3581,15 @@ virCgroupFree(virCgroupPtr group)
return;
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
VIR_FREE(group->legacy[i].mountPoint);
VIR_FREE(group->legacy[i].linkPoint);
VIR_FREE(group->legacy[i].placement);
g_free(group->legacy[i].mountPoint);
g_free(group->legacy[i].linkPoint);
g_free(group->legacy[i].placement);
}
VIR_FREE(group->unified.mountPoint);
VIR_FREE(group->unified.placement);
g_free(group->unified.mountPoint);
g_free(group->unified.placement);
VIR_FREE(group);
g_free(group);
}

View File

@ -3028,25 +3028,25 @@ virCommandFree(virCommandPtr cmd)
VIR_FORCE_CLOSE(cmd->passfd[i].fd);
}
cmd->npassfd = 0;
VIR_FREE(cmd->passfd);
g_free(cmd->passfd);
if (cmd->asyncioThread) {
virThreadJoin(cmd->asyncioThread);
VIR_FREE(cmd->asyncioThread);
g_free(cmd->asyncioThread);
}
VIR_FREE(cmd->inbuf);
g_free(cmd->inbuf);
VIR_FORCE_CLOSE(cmd->outfd);
VIR_FORCE_CLOSE(cmd->errfd);
for (i = 0; i < cmd->nargs; i++)
VIR_FREE(cmd->args[i]);
VIR_FREE(cmd->args);
g_free(cmd->args[i]);
g_free(cmd->args);
for (i = 0; i < cmd->nenv; i++)
VIR_FREE(cmd->env[i]);
VIR_FREE(cmd->env);
g_free(cmd->env[i]);
g_free(cmd->env);
VIR_FREE(cmd->pwd);
g_free(cmd->pwd);
if (cmd->handshake) {
/* The other 2 fds in these arrays are closed
@ -3056,21 +3056,21 @@ virCommandFree(virCommandPtr cmd)
VIR_FORCE_CLOSE(cmd->handshakeNotify[1]);
}
VIR_FREE(cmd->pidfile);
g_free(cmd->pidfile);
if (cmd->reap)
virCommandAbort(cmd);
#if defined(WITH_SECDRIVER_SELINUX)
VIR_FREE(cmd->seLinuxLabel);
g_free(cmd->seLinuxLabel);
#endif
#if defined(WITH_SECDRIVER_APPARMOR)
VIR_FREE(cmd->appArmorProfile);
g_free(cmd->appArmorProfile);
#endif
virCommandFreeSendBuffers(cmd);
VIR_FREE(cmd);
g_free(cmd);
}
/**

View File

@ -788,15 +788,15 @@ virConfFree(virConfPtr conf)
tmp = conf->entries;
while (tmp) {
virConfEntryPtr next;
VIR_FREE(tmp->name);
g_free(tmp->name);
virConfFreeValue(tmp->value);
VIR_FREE(tmp->comment);
g_free(tmp->comment);
next = tmp->next;
VIR_FREE(tmp);
g_free(tmp);
tmp = next;
}
VIR_FREE(conf->filename);
VIR_FREE(conf);
g_free(conf->filename);
g_free(conf);
return 0;
}

View File

@ -75,14 +75,14 @@ addnhostsFree(dnsmasqAddnHostsfile *addnhostsfile)
for (i = 0; i < addnhostsfile->nhosts; i++)
addnhostFree(&addnhostsfile->hosts[i]);
VIR_FREE(addnhostsfile->hosts);
g_free(addnhostsfile->hosts);
addnhostsfile->nhosts = 0;
}
VIR_FREE(addnhostsfile->path);
g_free(addnhostsfile->path);
VIR_FREE(addnhostsfile);
g_free(addnhostsfile);
}
static int
@ -272,14 +272,14 @@ hostsfileFree(dnsmasqHostsfile *hostsfile)
for (i = 0; i < hostsfile->nhosts; i++)
dhcphostFree(&hostsfile->hosts[i]);
VIR_FREE(hostsfile->hosts);
g_free(hostsfile->hosts);
hostsfile->nhosts = 0;
}
VIR_FREE(hostsfile->path);
g_free(hostsfile->path);
VIR_FREE(hostsfile);
g_free(hostsfile);
}
/* Note: There are many additional dhcp-host specifications
@ -465,14 +465,14 @@ dnsmasqContextFree(dnsmasqContext *ctx)
if (!ctx)
return;
VIR_FREE(ctx->config_dir);
g_free(ctx->config_dir);
if (ctx->hostsfile)
hostsfileFree(ctx->hostsfile);
if (ctx->addnhostsfile)
addnhostsFree(ctx->addnhostsfile);
VIR_FREE(ctx);
g_free(ctx);
}
/**

View File

@ -73,8 +73,8 @@ ebtablesContextFree(ebtablesContext *ctx)
{
if (!ctx)
return;
VIR_FREE(ctx->chain);
VIR_FREE(ctx);
g_free(ctx->chain);
g_free(ctx);
}

View File

@ -198,14 +198,14 @@ virFDStreamMsgFree(virFDStreamMsgPtr msg)
switch (msg->type) {
case VIR_FDSTREAM_MSG_TYPE_DATA:
VIR_FREE(msg->stream.data.buf);
g_free(msg->stream.data.buf);
break;
case VIR_FDSTREAM_MSG_TYPE_HOLE:
/* nada */
break;
}
VIR_FREE(msg);
g_free(msg);
}
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFDStreamMsg, virFDStreamMsgFree);
@ -413,9 +413,9 @@ virFDStreamThreadDataFree(virFDStreamThreadDataPtr data)
return;
virObjectUnref(data->st);
VIR_FREE(data->fdinname);
VIR_FREE(data->fdoutname);
VIR_FREE(data);
g_free(data->fdinname);
g_free(data->fdoutname);
g_free(data);
}

View File

@ -382,9 +382,9 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd)
if (!wfd)
return;
VIR_FREE(wfd->err_msg);
g_free(wfd->err_msg);
virCommandFree(wfd->cmd);
VIR_FREE(wfd);
g_free(wfd);
}

View File

@ -196,9 +196,9 @@ virFirewallRuleFree(virFirewallRulePtr rule)
return;
for (i = 0; i < rule->argsLen; i++)
VIR_FREE(rule->args[i]);
VIR_FREE(rule->args);
VIR_FREE(rule);
g_free(rule->args[i]);
g_free(rule->args);
g_free(rule);
}
@ -212,13 +212,13 @@ virFirewallGroupFree(virFirewallGroupPtr group)
for (i = 0; i < group->naction; i++)
virFirewallRuleFree(group->action[i]);
VIR_FREE(group->action);
g_free(group->action);
for (i = 0; i < group->nrollback; i++)
virFirewallRuleFree(group->rollback[i]);
VIR_FREE(group->rollback);
g_free(group->rollback);
VIR_FREE(group);
g_free(group);
}
@ -237,9 +237,9 @@ void virFirewallFree(virFirewallPtr firewall)
for (i = 0; i < firewall->ngroups; i++)
virFirewallGroupFree(firewall->groups[i]);
VIR_FREE(firewall->groups);
g_free(firewall->groups);
VIR_FREE(firewall);
g_free(firewall);
}
#define VIR_FIREWALL_RETURN_IF_ERROR(firewall) \

View File

@ -37,9 +37,9 @@ virFirmwareFree(virFirmwarePtr firmware)
if (!firmware)
return;
VIR_FREE(firmware->name);
VIR_FREE(firmware->nvram);
VIR_FREE(firmware);
g_free(firmware->name);
g_free(firmware->nvram);
g_free(firmware);
}
@ -51,7 +51,7 @@ virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares)
for (i = 0; i < nfirmwares; i++)
virFirmwareFree(firmwares[i]);
VIR_FREE(firmwares);
g_free(firmwares);
}

View File

@ -398,28 +398,28 @@ virJSONValueFree(virJSONValuePtr value)
switch ((virJSONType) value->type) {
case VIR_JSON_TYPE_OBJECT:
for (i = 0; i < value->data.object.npairs; i++) {
VIR_FREE(value->data.object.pairs[i].key);
g_free(value->data.object.pairs[i].key);
virJSONValueFree(value->data.object.pairs[i].value);
}
VIR_FREE(value->data.object.pairs);
g_free(value->data.object.pairs);
break;
case VIR_JSON_TYPE_ARRAY:
for (i = 0; i < value->data.array.nvalues; i++)
virJSONValueFree(value->data.array.values[i]);
VIR_FREE(value->data.array.values);
g_free(value->data.array.values);
break;
case VIR_JSON_TYPE_STRING:
VIR_FREE(value->data.string);
g_free(value->data.string);
break;
case VIR_JSON_TYPE_NUMBER:
VIR_FREE(value->data.number);
g_free(value->data.number);
break;
case VIR_JSON_TYPE_BOOLEAN:
case VIR_JSON_TYPE_NULL:
break;
}
VIR_FREE(value);
g_free(value);
}

View File

@ -102,11 +102,11 @@ static void virLockSpaceResourceFree(virLockSpaceResourcePtr res)
}
}
VIR_FREE(res->owners);
g_free(res->owners);
VIR_FORCE_CLOSE(res->fd);
VIR_FREE(res->path);
VIR_FREE(res->name);
VIR_FREE(res);
g_free(res->path);
g_free(res->name);
g_free(res);
}
@ -499,9 +499,9 @@ void virLockSpaceFree(virLockSpacePtr lockspace)
return;
virHashFree(lockspace->resources);
VIR_FREE(lockspace->dir);
g_free(lockspace->dir);
virMutexDestroy(&lockspace->lock);
VIR_FREE(lockspace);
g_free(lockspace);
}

View File

@ -339,8 +339,8 @@ virLogFilterFree(virLogFilterPtr filter)
if (!filter)
return;
VIR_FREE(filter->match);
VIR_FREE(filter);
g_free(filter->match);
g_free(filter);
}
@ -361,7 +361,7 @@ virLogFilterListFree(virLogFilterPtr *list, int count)
for (i = 0; i < count; i++)
virLogFilterFree(list[i]);
VIR_FREE(list);
g_free(list);
}
@ -387,8 +387,8 @@ virLogOutputFree(virLogOutputPtr output)
if (output->c)
output->c(output->data);
VIR_FREE(output->name);
VIR_FREE(output);
g_free(output->name);
g_free(output);
}
@ -410,7 +410,7 @@ virLogOutputListFree(virLogOutputPtr *list, int count)
for (i = 0; i < count; i++)
virLogOutputFree(list[i]);
VIR_FREE(list);
g_free(list);
}

View File

@ -250,5 +250,5 @@ virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN])
void
virMacAddrFree(virMacAddrPtr addr)
{
VIR_FREE(addr);
g_free(addr);
}

View File

@ -183,10 +183,10 @@ virMediatedDeviceFree(virMediatedDevicePtr dev)
{
if (!dev)
return;
VIR_FREE(dev->path);
VIR_FREE(dev->used_by_drvname);
VIR_FREE(dev->used_by_domname);
VIR_FREE(dev);
g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
g_free(dev);
}
@ -476,10 +476,10 @@ virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type)
if (!type)
return;
VIR_FREE(type->id);
VIR_FREE(type->name);
VIR_FREE(type->device_api);
VIR_FREE(type);
g_free(type->id);
g_free(type->name);
g_free(type->device_api);
g_free(type);
}

View File

@ -127,7 +127,7 @@ struct _virNetDevMcastEntry {
static void
virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry)
{
VIR_FREE(entry);
g_free(entry);
}
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree);
@ -2868,11 +2868,11 @@ void
virNetDevRxFilterFree(virNetDevRxFilterPtr filter)
{
if (filter) {
VIR_FREE(filter->name);
VIR_FREE(filter->unicast.table);
VIR_FREE(filter->multicast.table);
VIR_FREE(filter->vlan.table);
VIR_FREE(filter);
g_free(filter->name);
g_free(filter->unicast.table);
g_free(filter->multicast.table);
g_free(filter->vlan.table);
g_free(filter);
}
}

View File

@ -34,9 +34,9 @@ virNetDevBandwidthFree(virNetDevBandwidthPtr def)
if (!def)
return;
VIR_FREE(def->in);
VIR_FREE(def->out);
VIR_FREE(def);
g_free(def->in);
g_free(def->out);
g_free(def);
}
static void

View File

@ -775,8 +775,8 @@ virNetDevIPRouteFree(virNetDevIPRoutePtr def)
{
if (!def)
return;
VIR_FREE(def->family);
VIR_FREE(def);
g_free(def->family);
g_free(def);
}
virSocketAddrPtr
@ -913,5 +913,5 @@ virNetDevIPInfoAddToDev(const char *ifname,
void
virNetDevIPAddrFree(virNetDevIPAddrPtr ip)
{
VIR_FREE(ip);
g_free(ip);
}

View File

@ -563,11 +563,11 @@ static void
virNetlinkCallbackDataFree(virNetlinkCallbackDataPtr calld)
{
if (calld) {
VIR_FREE(calld->cr_ifname);
VIR_FREE(calld->virtPortProfile);
VIR_FREE(calld->linkdev);
g_free(calld->cr_ifname);
g_free(calld->virtPortProfile);
g_free(calld->linkdev);
}
VIR_FREE(calld);
g_free(calld);
}
/**

View File

@ -39,7 +39,7 @@ virNetDevVlanFree(virNetDevVlanPtr vlan)
{
if (vlan)
virNetDevVlanClear(vlan);
VIR_FREE(vlan);
g_free(vlan);
}
int

View File

@ -86,7 +86,7 @@ virNVMeDeviceFree(virNVMeDevicePtr dev)
return;
virNVMeDeviceUsedByClear(dev);
VIR_FREE(dev);
g_free(dev);
}

View File

@ -632,7 +632,7 @@ virObjectListFree(void *list)
for (next = (void **) list; *next; next++)
virObjectUnref(*next);
VIR_FREE(list);
g_free(list);
}

View File

@ -1520,11 +1520,11 @@ virPCIDeviceFree(virPCIDevicePtr dev)
if (!dev)
return;
VIR_DEBUG("%s %s: freeing", dev->id, dev->name);
VIR_FREE(dev->name);
VIR_FREE(dev->path);
VIR_FREE(dev->used_by_drvname);
VIR_FREE(dev->used_by_domname);
VIR_FREE(dev);
g_free(dev->name);
g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
g_free(dev);
}
/**
@ -2819,13 +2819,13 @@ virPCIEDeviceInfoFree(virPCIEDeviceInfoPtr dev)
if (!dev)
return;
VIR_FREE(dev->link_cap);
VIR_FREE(dev->link_sta);
VIR_FREE(dev);
g_free(dev->link_cap);
g_free(dev->link_sta);
g_free(dev);
}
void
virPCIDeviceAddressFree(virPCIDeviceAddressPtr address)
{
VIR_FREE(address);
g_free(address);
}

View File

@ -394,5 +394,5 @@ virPerfFree(virPerfPtr perf)
virPerfEventDisable(perf, i);
}
VIR_FREE(perf);
g_free(perf);
}

View File

@ -117,8 +117,8 @@ virPortAllocatorRangeFree(virPortAllocatorRangePtr range)
if (!range)
return;
VIR_FREE(range->name);
VIR_FREE(range);
g_free(range->name);
g_free(range);
}
static int

View File

@ -232,7 +232,7 @@ virResctrlInfoMonFree(virResctrlInfoMonPtr mon)
return;
g_strfreev(mon->features);
VIR_FREE(mon);
g_free(mon);
}
@ -2752,6 +2752,6 @@ virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stat)
return;
g_strfreev(stat->features);
VIR_FREE(stat->vals);
VIR_FREE(stat);
g_free(stat->vals);
g_free(stat);
}

View File

@ -80,7 +80,7 @@ virRotatingFileWriterEntryFree(virRotatingFileWriterEntryPtr entry)
return;
VIR_FORCE_CLOSE(entry->fd);
VIR_FREE(entry);
g_free(entry);
}
@ -90,9 +90,9 @@ virRotatingFileReaderEntryFree(virRotatingFileReaderEntryPtr entry)
if (!entry)
return;
VIR_FREE(entry->path);
g_free(entry->path);
VIR_FORCE_CLOSE(entry->fd);
VIR_FREE(entry);
g_free(entry);
}
@ -610,8 +610,8 @@ virRotatingFileWriterFree(virRotatingFileWriterPtr file)
return;
virRotatingFileWriterEntryFree(file->entry);
VIR_FREE(file->basepath);
VIR_FREE(file);
g_free(file->basepath);
g_free(file);
}
@ -631,6 +631,6 @@ virRotatingFileReaderFree(virRotatingFileReaderPtr file)
for (i = 0; i < file->nentries; i++)
virRotatingFileReaderEntryFree(file->entries[i]);
VIR_FREE(file->entries);
VIR_FREE(file);
g_free(file->entries);
g_free(file);
}

View File

@ -222,9 +222,9 @@ virSCSIDeviceNew(const char *sysfs_prefix,
static void
virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by)
{
VIR_FREE(used_by->drvname);
VIR_FREE(used_by->domname);
VIR_FREE(used_by);
g_free(used_by->drvname);
g_free(used_by->domname);
g_free(used_by);
}
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree);
@ -236,13 +236,13 @@ virSCSIDeviceFree(virSCSIDevicePtr dev)
if (!dev)
return;
VIR_FREE(dev->id);
VIR_FREE(dev->name);
VIR_FREE(dev->sg_path);
g_free(dev->id);
g_free(dev->name);
g_free(dev->sg_path);
for (i = 0; i < dev->n_used_by; i++)
virSCSIDeviceUsedByInfoFree(dev->used_by[i]);
VIR_FREE(dev->used_by);
VIR_FREE(dev);
g_free(dev->used_by);
g_free(dev);
}
int

View File

@ -268,9 +268,9 @@ virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev)
if (!dev)
return;
VIR_DEBUG("%s: freeing", dev->name);
VIR_FREE(dev->name);
VIR_FREE(dev->path);
VIR_FREE(dev->used_by_drvname);
VIR_FREE(dev->used_by_domname);
VIR_FREE(dev);
g_free(dev->name);
g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
g_free(dev);
}

View File

@ -34,11 +34,11 @@ virSecurityLabelDefFree(virSecurityLabelDefPtr def)
{
if (!def)
return;
VIR_FREE(def->model);
VIR_FREE(def->label);
VIR_FREE(def->imagelabel);
VIR_FREE(def->baselabel);
VIR_FREE(def);
g_free(def->model);
g_free(def->label);
g_free(def->imagelabel);
g_free(def->baselabel);
g_free(def);
}
@ -47,9 +47,9 @@ virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def)
{
if (!def)
return;
VIR_FREE(def->model);
VIR_FREE(def->label);
VIR_FREE(def);
g_free(def->model);
g_free(def->label);
g_free(def);
}

View File

@ -1307,5 +1307,5 @@ virSocketAddrPTRDomain(const virSocketAddr *addr,
void
virSocketAddrFree(virSocketAddrPtr addr)
{
VIR_FREE(addr);
g_free(addr);
}

View File

@ -68,11 +68,11 @@ void virSysinfoBIOSDefFree(virSysinfoBIOSDefPtr def)
if (def == NULL)
return;
VIR_FREE(def->vendor);
VIR_FREE(def->version);
VIR_FREE(def->date);
VIR_FREE(def->release);
VIR_FREE(def);
g_free(def->vendor);
g_free(def->version);
g_free(def->date);
g_free(def->release);
g_free(def);
}
void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def)
@ -80,14 +80,14 @@ void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def)
if (def == NULL)
return;
VIR_FREE(def->manufacturer);
VIR_FREE(def->product);
VIR_FREE(def->version);
VIR_FREE(def->serial);
VIR_FREE(def->uuid);
VIR_FREE(def->sku);
VIR_FREE(def->family);
VIR_FREE(def);
g_free(def->manufacturer);
g_free(def->product);
g_free(def->version);
g_free(def->serial);
g_free(def->uuid);
g_free(def->sku);
g_free(def->family);
g_free(def);
}
void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def)
@ -109,12 +109,12 @@ void virSysinfoChassisDefFree(virSysinfoChassisDefPtr def)
if (def == NULL)
return;
VIR_FREE(def->manufacturer);
VIR_FREE(def->version);
VIR_FREE(def->serial);
VIR_FREE(def->asset);
VIR_FREE(def->sku);
VIR_FREE(def);
g_free(def->manufacturer);
g_free(def->version);
g_free(def->serial);
g_free(def->asset);
g_free(def->sku);
g_free(def);
}
@ -126,10 +126,10 @@ void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def)
return;
for (i = 0; i < def->nvalues; i++)
VIR_FREE(def->values[i]);
VIR_FREE(def->values);
g_free(def->values[i]);
g_free(def->values);
VIR_FREE(def);
g_free(def);
}
@ -164,45 +164,45 @@ void virSysinfoDefFree(virSysinfoDefPtr def)
for (i = 0; i < def->nbaseBoard; i++)
virSysinfoBaseBoardDefClear(def->baseBoard + i);
VIR_FREE(def->baseBoard);
g_free(def->baseBoard);
virSysinfoChassisDefFree(def->chassis);
for (i = 0; i < def->nprocessor; i++) {
VIR_FREE(def->processor[i].processor_socket_destination);
VIR_FREE(def->processor[i].processor_type);
VIR_FREE(def->processor[i].processor_family);
VIR_FREE(def->processor[i].processor_manufacturer);
VIR_FREE(def->processor[i].processor_signature);
VIR_FREE(def->processor[i].processor_version);
VIR_FREE(def->processor[i].processor_external_clock);
VIR_FREE(def->processor[i].processor_max_speed);
VIR_FREE(def->processor[i].processor_status);
VIR_FREE(def->processor[i].processor_serial_number);
VIR_FREE(def->processor[i].processor_part_number);
g_free(def->processor[i].processor_socket_destination);
g_free(def->processor[i].processor_type);
g_free(def->processor[i].processor_family);
g_free(def->processor[i].processor_manufacturer);
g_free(def->processor[i].processor_signature);
g_free(def->processor[i].processor_version);
g_free(def->processor[i].processor_external_clock);
g_free(def->processor[i].processor_max_speed);
g_free(def->processor[i].processor_status);
g_free(def->processor[i].processor_serial_number);
g_free(def->processor[i].processor_part_number);
}
VIR_FREE(def->processor);
g_free(def->processor);
for (i = 0; i < def->nmemory; i++) {
VIR_FREE(def->memory[i].memory_size);
VIR_FREE(def->memory[i].memory_form_factor);
VIR_FREE(def->memory[i].memory_locator);
VIR_FREE(def->memory[i].memory_bank_locator);
VIR_FREE(def->memory[i].memory_type);
VIR_FREE(def->memory[i].memory_type_detail);
VIR_FREE(def->memory[i].memory_speed);
VIR_FREE(def->memory[i].memory_manufacturer);
VIR_FREE(def->memory[i].memory_serial_number);
VIR_FREE(def->memory[i].memory_part_number);
g_free(def->memory[i].memory_size);
g_free(def->memory[i].memory_form_factor);
g_free(def->memory[i].memory_locator);
g_free(def->memory[i].memory_bank_locator);
g_free(def->memory[i].memory_type);
g_free(def->memory[i].memory_type_detail);
g_free(def->memory[i].memory_speed);
g_free(def->memory[i].memory_manufacturer);
g_free(def->memory[i].memory_serial_number);
g_free(def->memory[i].memory_part_number);
}
VIR_FREE(def->memory);
g_free(def->memory);
virSysinfoOEMStringsDefFree(def->oemStrings);
for (i = 0; i < def->nfw_cfgs; i++)
virSysinfoFWCfgDefClear(&def->fw_cfgs[i]);
VIR_FREE(def->fw_cfgs);
g_free(def->fw_cfgs);
VIR_FREE(def);
g_free(def);
}

View File

@ -640,8 +640,8 @@ virSystemdActivationEntryFree(void *data)
VIR_FORCE_CLOSE(ent->fds[i]);
}
VIR_FREE(ent->fds);
VIR_FREE(ent);
g_free(ent->fds);
g_free(ent);
}
@ -1048,5 +1048,5 @@ virSystemdActivationFree(virSystemdActivationPtr act)
virHashFree(act->fds);
VIR_FREE(act);
g_free(act);
}

View File

@ -305,14 +305,14 @@ void virThreadPoolFree(virThreadPoolPtr pool)
virMutexLock(&pool->mutex);
virThreadPoolDrainLocked(pool);
VIR_FREE(pool->workers);
g_free(pool->workers);
virMutexUnlock(&pool->mutex);
virMutexDestroy(&pool->mutex);
virCondDestroy(&pool->quit_cond);
virCondDestroy(&pool->cond);
VIR_FREE(pool->prioWorkers);
g_free(pool->prioWorkers);
virCondDestroy(&pool->prioCond);
VIR_FREE(pool);
g_free(pool);
}

View File

@ -880,5 +880,5 @@ virTypedParamsFree(virTypedParameterPtr params,
int nparams)
{
virTypedParamsClear(params, nparams);
VIR_FREE(params);
g_free(params);
}

View File

@ -485,11 +485,11 @@ virTypedParamsRemoteFree(virTypedParameterRemotePtr remote_params_val,
return;
for (i = 0; i < remote_params_len; i++) {
VIR_FREE(remote_params_val[i].field);
g_free(remote_params_val[i].field);
if (remote_params_val[i].value.type == VIR_TYPED_PARAM_STRING)
VIR_FREE(remote_params_val[i].value.remote_typed_param_value.s);
g_free(remote_params_val[i].value.remote_typed_param_value.s);
}
VIR_FREE(remote_params_val);
g_free(remote_params_val);
}
@ -724,7 +724,7 @@ virTypedParamListFree(virTypedParamListPtr list)
return;
virTypedParamsFree(list->par, list->npar);
VIR_FREE(list);
g_free(list);
}

View File

@ -279,20 +279,20 @@ void virURIFree(virURIPtr uri)
if (!uri)
return;
VIR_FREE(uri->scheme);
VIR_FREE(uri->server);
VIR_FREE(uri->user);
VIR_FREE(uri->path);
VIR_FREE(uri->query);
VIR_FREE(uri->fragment);
g_free(uri->scheme);
g_free(uri->server);
g_free(uri->user);
g_free(uri->path);
g_free(uri->query);
g_free(uri->fragment);
for (i = 0; i < uri->paramsCount; i++) {
VIR_FREE(uri->params[i].name);
VIR_FREE(uri->params[i].value);
g_free(uri->params[i].name);
g_free(uri->params[i].value);
}
VIR_FREE(uri->params);
g_free(uri->params);
VIR_FREE(uri);
g_free(uri);
}

View File

@ -354,10 +354,10 @@ virUSBDeviceFree(virUSBDevicePtr dev)
if (!dev)
return;
VIR_DEBUG("%s %s: freeing", dev->id, dev->name);
VIR_FREE(dev->path);
VIR_FREE(dev->used_by_drvname);
VIR_FREE(dev->used_by_domname);
VIR_FREE(dev);
g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
g_free(dev);
}
int

View File

@ -1312,12 +1312,12 @@ virXMLValidatorFree(virXMLValidatorPtr validator)
if (!validator)
return;
VIR_FREE(validator->schemafile);
g_free(validator->schemafile);
virBufferFreeAndReset(&validator->buf);
xmlRelaxNGFreeParserCtxt(validator->rngParser);
xmlRelaxNGFreeValidCtxt(validator->rngValid);
xmlRelaxNGFree(validator->rng);
VIR_FREE(validator);
g_free(validator);
}