Use g_strfeev instead of virStringFreeList

Both accept a NULL value gracefully and virStringFreeList
does not zero the pointer afterwards, so a straight replace
is safe.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2020-08-02 19:36:03 +02:00
parent 201dcc1690
commit ee247e1d3f
52 changed files with 145 additions and 145 deletions

View File

@ -666,7 +666,7 @@ virAppendBootloaderArgs(virCommandPtr cmd, virDomainDefPtr def)
/* XXX: Handle quoted? */
blargs = virStringSplit(def->os.bootloaderArgs, " ", 0);
virCommandAddArgSet(cmd, (const char * const *)blargs);
virStringListFree(blargs);
g_strfreev(blargs);
}
static virCommandPtr

View File

@ -246,7 +246,7 @@ bhyveCommandLineToArgv(const char *nativeConfig,
} else {
/* To prevent a use-after-free here, only free the argument list
* when it is definitely not going to be used */
virStringListFree(arglist);
g_strfreev(arglist);
}
}
@ -254,13 +254,13 @@ bhyveCommandLineToArgv(const char *nativeConfig,
if (!(*bhyve_argv = _bhyve_argv))
goto error;
virStringListFree(lines);
g_strfreev(lines);
return 0;
error:
VIR_FREE(_loader_argv);
VIR_FREE(_bhyve_argv);
virStringListFree(lines);
g_strfreev(lines);
return -1;
}
@ -884,8 +884,8 @@ bhyveParseCommandLineString(const char* nativeConfig,
}
cleanup:
virStringListFree(loader_argv);
virStringListFree(bhyve_argv);
g_strfreev(loader_argv);
g_strfreev(bhyve_argv);
return def;
error:
virDomainDefFree(def);

View File

@ -114,7 +114,7 @@ virDomainCapsCPUModelsDispose(void *obj)
for (i = 0; i < cpuModels->nmodels; i++) {
VIR_FREE(cpuModels->models[i].name);
virStringListFree(cpuModels->models[i].blockers);
g_strfreev(cpuModels->models[i].blockers);
}
VIR_FREE(cpuModels->models);

View File

@ -112,7 +112,7 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def)
VIR_FREE(def->sysfs_path);
VIR_FREE(def->parent_sysfs_path);
VIR_FREE(def->devnode);
virStringListFree(def->devlinks);
g_strfreev(def->devlinks);
caps = def->caps;
while (caps) {

View File

@ -124,7 +124,7 @@ virCPUarmDataClear(virCPUarmData *data)
if (!data)
return;
virStringListFree(data->features);
g_strfreev(data->features);
}
static void

View File

@ -801,7 +801,7 @@ virCPUppc64DriverGetModels(char ***models)
error:
if (models) {
virStringListFree(*models);
g_strfreev(*models);
*models = NULL;
}
goto cleanup;

View File

@ -1922,7 +1922,7 @@ libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg,
goto cleanup;
}
}
virStringListFree(mem_tokens);
g_strfreev(mem_tokens);
mem_tokens = NULL;
}
@ -1938,8 +1938,8 @@ libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg,
ret = 0;
cleanup:
virStringListFree(cmd_tokens);
virStringListFree(mem_tokens);
g_strfreev(cmd_tokens);
g_strfreev(mem_tokens);
return ret;
}

View File

@ -1061,20 +1061,20 @@ xenParseVifBridge(virDomainNetDefPtr net, char *bridge)
nvlans++;
if (VIR_ALLOC_N(net->vlan.tag, nvlans) < 0) {
virStringListFree(vlanstr_list);
g_strfreev(vlanstr_list);
return -1;
}
for (i = 1; i <= nvlans; i++) {
if (virStrToLong_ui(vlanstr_list[i], NULL, 10, &tag) < 0) {
virStringListFree(vlanstr_list);
g_strfreev(vlanstr_list);
return -1;
}
net->vlan.tag[i - 1] = tag;
}
net->vlan.nTags = nvlans;
net->vlan.trunk = true;
virStringListFree(vlanstr_list);
g_strfreev(vlanstr_list);
if (VIR_ALLOC(net->virtPortProfile) < 0)
return -1;
@ -1270,11 +1270,11 @@ xenParseVif(char *entry, const char *vif_typename)
for (i = 0; ip_list[i]; i++) {
if (virDomainNetAppendIPAddress(net, ip_list[i], 0, 0) < 0) {
virStringListFree(ip_list);
g_strfreev(ip_list);
goto cleanup;
}
}
virStringListFree(ip_list);
g_strfreev(ip_list);
}
if (script && script[0])
@ -1679,7 +1679,7 @@ xenMakeIPList(virNetDevIPInfoPtr guestIP)
ret = virStringListJoin((const char**)address_array, " ");
cleanup:
virStringListFree(address_array);
g_strfreev(address_array);
return ret;
}

View File

@ -318,15 +318,15 @@ xenParseXLCPUID(virConfPtr conf, virDomainDefPtr def)
policy) < 0)
goto cleanup;
virStringListFree(name_and_value);
g_strfreev(name_and_value);
name_and_value = NULL;
}
ret = 0;
cleanup:
virStringListFree(name_and_value);
virStringListFree(cpuid_pairs);
g_strfreev(name_and_value);
g_strfreev(cpuid_pairs);
return ret;
}
@ -528,7 +528,7 @@ xenParseXLVnuma(virConfPtr conf,
VIR_FREE(tmp);
tmp = g_strdup(vtoken);
virStringListFree(token);
g_strfreev(token);
if (!(token = virStringSplitCount(tmp, ",", 0, &ndistances)))
goto cleanup;
@ -590,7 +590,7 @@ xenParseXLVnuma(virConfPtr conf,
cleanup:
if (ret)
VIR_FREE(cpu);
virStringListFree(token);
g_strfreev(token);
VIR_FREE(tmp);
return ret;
@ -1402,7 +1402,7 @@ xenFormatXLCPUID(virConfPtr conf, virDomainDefPtr def)
ret = 0;
cleanup:
virStringListFree(cpuid_pairs);
g_strfreev(cpuid_pairs);
VIR_FREE(cpuid_string);
return ret;
}

View File

@ -281,7 +281,7 @@ xenParseXMDiskList(virConfPtr conf, virDomainDefPtr def)
ret = 0;
cleanup:
virStringListFree(disks);
g_strfreev(disks);
return ret;
}

View File

@ -553,7 +553,7 @@ static int lxcContainerUnmountSubtree(const char *prefix,
ret = 0;
cleanup:
virStringListFree(mounts);
g_strfreev(mounts);
return ret;
}

View File

@ -136,12 +136,12 @@ static char ** lxcStringSplit(const char *string)
result[ntokens - 2] = g_strdup(parts[i]);
}
virStringListFree(parts);
g_strfreev(parts);
return result;
error:
virStringListFree(parts);
virStringListFree(result);
g_strfreev(parts);
g_strfreev(result);
return NULL;
}
@ -166,13 +166,13 @@ lxcParseFstabLine(char *fstabLine)
fstab->type = g_strdup(parts[2]);
fstab->options = g_strdup(parts[3]);
virStringListFree(parts);
g_strfreev(parts);
return fstab;
error:
lxcFstabFree(fstab);
virStringListFree(parts);
g_strfreev(parts);
return NULL;
}
@ -312,7 +312,7 @@ lxcAddFstabLine(virDomainDefPtr def, lxcFstabPtr fstab)
ret = 1;
cleanup:
virStringListFree(options);
g_strfreev(options);
return ret;
}
@ -575,11 +575,11 @@ lxcNetworkParseDataIPs(const char *name,
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid CIDR address: '%s'"), value->str);
virStringListFree(ipparts);
g_strfreev(ipparts);
return -1;
}
virStringListFree(ipparts);
g_strfreev(ipparts);
if (VIR_APPEND_ELEMENT(parseData->ips, parseData->nips, ip) < 0)
return -1;
@ -1070,7 +1070,7 @@ lxcBlkioDeviceWalkCallback(const char *name, virConfValuePtr value, void *data)
ret = 0;
cleanup:
virStringListFree(parts);
g_strfreev(parts);
return ret;
}
@ -1114,7 +1114,7 @@ lxcSetCapDrop(virDomainDefPtr def, virConfPtr properties)
def->features[VIR_DOMAIN_FEATURE_CAPABILITIES] = VIR_DOMAIN_CAPABILITIES_POLICY_ALLOW;
virStringListFree(toDrop);
g_strfreev(toDrop);
}
virDomainDefPtr

View File

@ -2165,7 +2165,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent,
}
/* Has to be freed for each interface. */
virStringListFree(ifname);
g_strfreev(ifname);
/* as well as IP address which - moreover -
* can be presented multiple times */
@ -2251,7 +2251,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent,
virDomainInterfaceFree(ifaces_ret[i]);
}
VIR_FREE(ifaces_ret);
virStringListFree(ifname);
g_strfreev(ifname);
goto cleanup;
}

View File

@ -3166,7 +3166,7 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps,
else
ret = 0;
virStringListFree(list);
g_strfreev(list);
return ret;
}
@ -3222,7 +3222,7 @@ virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps,
virQEMUCapsTPMModelsToCaps[i].caps);
}
}
virStringListFree(entries);
g_strfreev(entries);
if ((nentries = qemuMonitorGetTPMTypes(mon, &entries)) < 0)
return -1;
@ -3235,7 +3235,7 @@ virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps,
virQEMUCapsSet(qemuCaps, virQEMUCapsTPMTypesToCaps[i].caps);
}
}
virStringListFree(entries);
g_strfreev(entries);
return 0;
}
@ -3324,7 +3324,7 @@ virQEMUCapsProbeQMPCommandLine(virQEMUCapsPtr qemuCaps,
break;
}
}
virStringListFree(values);
g_strfreev(values);
}
return 0;

View File

@ -300,7 +300,7 @@ static void virQEMUDriverConfigDispose(void *obj)
virBitmapFree(cfg->namespaces);
virStringListFree(cfg->cgroupDeviceACL);
g_strfreev(cfg->cgroupDeviceACL);
VIR_FREE(cfg->uri);
VIR_FREE(cfg->configBaseDir);
@ -365,7 +365,7 @@ static void virQEMUDriverConfigDispose(void *obj)
VIR_FREE(cfg->snapshotImageFormat);
VIR_FREE(cfg->autoDumpPath);
virStringListFree(cfg->securityDriverNames);
g_strfreev(cfg->securityDriverNames);
VIR_FREE(cfg->lockManagerName);
@ -374,7 +374,7 @@ static void virQEMUDriverConfigDispose(void *obj)
VIR_FREE(cfg->memoryBackingDir);
VIR_FREE(cfg->swtpmStorageDir);
virStringListFree(cfg->capabilityfilters);
g_strfreev(cfg->capabilityfilters);
}

View File

@ -1687,7 +1687,7 @@ qemuDomainObjPrivateAlloc(void *opaque)
void
qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv)
{
virStringListFree(priv->qemuDevices);
g_strfreev(priv->qemuDevices);
priv->qemuDevices = NULL;
virCgroupFree(&priv->cgroup);
@ -1749,7 +1749,7 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv)
priv->dbusDaemonRunning = false;
virStringListFree(priv->dbusVMStateIds);
g_strfreev(priv->dbusVMStateIds);
priv->dbusVMStateIds = NULL;
priv->dbusVMState = false;
@ -3129,7 +3129,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
priv->namespaces = NULL;
virObjectUnref(priv->monConfig);
priv->monConfig = NULL;
virStringListFree(priv->qemuDevices);
g_strfreev(priv->qemuDevices);
priv->qemuDevices = NULL;
return -1;
}
@ -7729,7 +7729,7 @@ qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
if (rc < 0)
return -1;
virStringListFree(priv->qemuDevices);
g_strfreev(priv->qemuDevices);
priv->qemuDevices = aliases;
return 0;
}

View File

@ -1401,7 +1401,7 @@ qemuGetSchedInfo(unsigned long long *cpuWait,
ret = 0;
cleanup:
virStringListFree(lines);
g_strfreev(lines);
return ret;
}
@ -13479,7 +13479,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
cleanup:
virCPUDefListFree(cpus);
virCPUDefFree(cpu);
virStringListFree(features);
g_strfreev(features);
return cpustr;
}

View File

@ -1462,7 +1462,7 @@ qemuMigrationCapsCheck(virQEMUDriverPtr driver,
cleanup:
virBitmapFree(migEvent);
virJSONValueFree(json);
virStringListFree(caps);
g_strfreev(caps);
return ret;
}

View File

@ -6119,7 +6119,7 @@ int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
cleanup:
virStringListFree(commandlist);
g_strfreev(commandlist);
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
@ -6178,7 +6178,7 @@ int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
eventlist = NULL;
cleanup:
virStringListFree(eventlist);
g_strfreev(eventlist);
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
@ -6299,7 +6299,7 @@ qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
if (!qemuMonitorGetOptions(mon))
qemuMonitorSetOptions(mon, virJSONValueNewArray());
virStringListFree(paramlist);
g_strfreev(paramlist);
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
@ -6397,7 +6397,7 @@ int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon,
typelist = NULL;
cleanup:
virStringListFree(typelist);
g_strfreev(typelist);
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
@ -6727,7 +6727,7 @@ qemuMonitorJSONParsePropsList(virJSONValuePtr cmd,
proplist = NULL;
cleanup:
virStringListFree(proplist);
g_strfreev(proplist);
return ret;
}
@ -6911,7 +6911,7 @@ qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
list = NULL;
cleanup:
virStringListFree(list);
g_strfreev(list);
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
@ -7351,7 +7351,7 @@ qemuMonitorJSONGetStringArray(qemuMonitorPtr mon, const char *qmpCmd,
list = NULL;
cleanup:
virStringListFree(list);
g_strfreev(list);
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;

View File

@ -3732,7 +3732,7 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver,
ret = 0;
cleanup:
virStringListFree(old);
g_strfreev(old);
return ret;
}

View File

@ -5903,7 +5903,7 @@ remoteDispatchConnectGetCPUModelNames(virNetServerPtr server G_GNUC_UNUSED,
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virStringListFree(models);
g_strfreev(models);
return rv;
}

View File

@ -6529,7 +6529,7 @@ remoteConnectGetCPUModelNames(virConnectPtr conn,
rv = ret.ret;
cleanup:
virStringListFree(retmodels);
g_strfreev(retmodels);
xdr_free((xdrproc_t) xdr_remote_connect_get_cpu_model_names_ret, (char *) &ret);

View File

@ -746,7 +746,7 @@ virStorageBackendRBDRefreshPool(virStoragePoolObjPtr pool)
ret = 0;
cleanup:
virStringListFree(names);
g_strfreev(names);
virStorageBackendRBDFreeState(&ptr);
return ret;
}

View File

@ -167,7 +167,7 @@ virStorageBackendSheepdogRefreshAllVol(virStoragePoolObjPtr pool)
return -1;
}
virStringListFree(cells);
g_strfreev(cells);
cells = NULL;
}

View File

@ -253,7 +253,7 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED)
if (STREQ(lines[i], ""))
continue;
virStringListFree(tokens);
g_strfreev(tokens);
if (!(tokens = virStringSplitCount(lines[i], "\t", 0, &count)))
goto cleanup;

View File

@ -542,7 +542,7 @@ virCgroupGetValueForBlkDev(const char *str,
ret = 0;
error:
virStringListFree(lines);
g_strfreev(lines);
return ret;
}
@ -803,7 +803,7 @@ virCgroupSetPartitionSuffix(const char *path, char **res)
ret = 0;
cleanup:
virStringListFree(tokens);
g_strfreev(tokens);
return ret;
}

View File

@ -284,7 +284,7 @@ virCgroupV2ParseControllersFile(virCgroupPtr group,
tmp++;
}
virStringListFree(contList);
g_strfreev(contList);
return 0;
}

View File

@ -932,7 +932,7 @@ int virConfGetValueStringList(virConfPtr conf,
if (!cval)
return 0;
virStringListFree(*values);
g_strfreev(*values);
*values = NULL;
switch (cval->type) {

View File

@ -2010,7 +2010,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath,
cleanup:
if (ret < 0)
virStringListFree(mounts);
g_strfreev(mounts);
endmntent(procmnt);
return ret;
}

View File

@ -84,7 +84,7 @@ virFirmwareParse(const char *str, virFirmwarePtr firmware)
ret = 0;
cleanup:
virStringListFree(token);
g_strfreev(token);
return ret;
}
@ -128,6 +128,6 @@ virFirmwareParseList(const char *list,
ret = 0;
cleanup:
virStringListFree(token);
g_strfreev(token);
return ret;
}

View File

@ -1539,7 +1539,7 @@ virLogParseOutput(const char *src)
}
cleanup:
virStringListFree(tokens);
g_strfreev(tokens);
return ret;
}
@ -1614,7 +1614,7 @@ virLogParseFilter(const char *src)
goto cleanup;
cleanup:
virStringListFree(tokens);
g_strfreev(tokens);
return ret;
}
@ -1674,7 +1674,7 @@ virLogParseOutputs(const char *src, virLogOutputPtr **outputs)
*outputs = list;
list = NULL;
cleanup:
virStringListFree(strings);
g_strfreev(strings);
return ret;
}
@ -1724,7 +1724,7 @@ virLogParseFilters(const char *src, virLogFilterPtr **filters)
*filters = list;
list = NULL;
cleanup:
virStringListFree(strings);
g_strfreev(strings);
return ret;
}

View File

@ -55,7 +55,7 @@ virMacMapHashFree(void *payload,
const void *name G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
virStringListFree(payload);
g_strfreev(payload);
return 0;
}

View File

@ -216,7 +216,7 @@ virResctrlInfoDispose(void *obj)
}
if (resctrl->monitor_info)
virStringListFree(resctrl->monitor_info->features);
g_strfreev(resctrl->monitor_info->features);
VIR_FREE(resctrl->membw_info);
VIR_FREE(resctrl->levels);
@ -230,7 +230,7 @@ virResctrlInfoMonFree(virResctrlInfoMonPtr mon)
if (!mon)
return;
virStringListFree(mon->features);
g_strfreev(mon->features);
VIR_FREE(mon);
}
@ -780,7 +780,7 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
ret = 0;
cleanup:
VIR_FREE(featurestr);
virStringListFree(features);
g_strfreev(features);
VIR_FREE(info_monitor);
return ret;
}
@ -1558,7 +1558,7 @@ virResctrlAllocParseMemoryBandwidthLine(virResctrlInfoPtr resctrl,
ret = 0;
cleanup:
virStringListFree(mbs);
g_strfreev(mbs);
return ret;
}
@ -1732,7 +1732,7 @@ virResctrlAllocParseCacheLine(virResctrlInfoPtr resctrl,
ret = 0;
cleanup:
virStringListFree(caches);
g_strfreev(caches);
return ret;
}
@ -1758,7 +1758,7 @@ virResctrlAllocParse(virResctrlInfoPtr resctrl,
ret = 0;
cleanup:
virStringListFree(lines);
g_strfreev(lines);
return ret;
}
@ -2793,7 +2793,7 @@ virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stat)
if (!stat)
return;
virStringListFree(stat->features);
g_strfreev(stat->features);
VIR_FREE(stat->vals);
VIR_FREE(stat);
}

View File

@ -282,7 +282,7 @@ void virStringListAutoFree(char ***strings)
if (!*strings)
return;
virStringListFree(*strings);
g_strfreev(*strings);
*strings = NULL;
}
@ -985,7 +985,7 @@ virStringSearch(const char *str,
cleanup:
if (ret < 0) {
virStringListFree(*matches);
g_strfreev(*matches);
*matches = NULL;
}
return ret;

View File

@ -370,7 +370,7 @@ virURIResolveAlias(virConfPtr conf, const char *alias, char **uri)
if (aliases && *aliases) {
ret = virURIFindAliasMatch(aliases, alias, uri);
virStringListFree(aliases);
g_strfreev(aliases);
} else {
ret = 0;
}

View File

@ -5005,7 +5005,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
tmp = virStringReplace(newSnapshotPtr->storageController,
searchResultTab[it],
uuidReplacing);
virStringListFree(searchResultTab);
g_strfreev(searchResultTab);
searchResultTab = NULL;
VIR_FREE(newSnapshotPtr->storageController);
if (!tmp)
@ -5405,9 +5405,9 @@ vboxSnapshotRedefine(virDomainPtr dom,
VIR_FREE(currentSnapshotXmlFilePath);
VBOX_UTF16_FREE(machineNameUtf16);
VBOX_UTF8_FREE(machineName);
virStringListFree(realReadOnlyDisksPath);
virStringListFree(realReadWriteDisksPath);
virStringListFree(searchResultTab);
g_strfreev(realReadOnlyDisksPath);
g_strfreev(realReadWriteDisksPath);
g_strfreev(searchResultTab);
virVboxSnapshotConfHardDiskFree(newHardDisk);
VIR_FREE(hardDiskToOpen);
VIR_FREE(newSnapshotPtr);
@ -7256,7 +7256,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
VBOX_RELEASE(machine);
VBOX_UTF16_FREE(settingsFilePathUtf16);
VBOX_UTF8_FREE(settingsFilepath);
virStringListFree(searchResultTab);
g_strfreev(searchResultTab);
VIR_FREE(snapshotMachineDesc);
VBOX_UTF16_FREE(machineNameUtf16);
VBOX_UTF8_FREE(machineName);

View File

@ -103,7 +103,7 @@ virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(xmlNodePtr diskNode,
VIR_FREE(nodes);
VIR_FREE(location);
VIR_FREE(tmp);
virStringListFree(searchTabResult);
g_strfreev(searchTabResult);
if (result < 0) {
virVboxSnapshotConfHardDiskFree(hardDisk);
hardDisk = NULL;
@ -271,7 +271,7 @@ virVBoxSnapshotConfRetrieveSnapshot(xmlNodePtr snapshotNode,
}
VIR_FREE(nodes);
VIR_FREE(uuid);
virStringListFree(searchTabResult);
g_strfreev(searchTabResult);
return snapshot;
}
@ -451,8 +451,8 @@ virVBoxSnapshotConfSerializeSnapshot(xmlNodePtr node,
xmlUnlinkNode(snapshotsNode);
xmlFreeNode(snapshotsNode);
}
virStringListFree(firstRegex);
virStringListFree(secondRegex);
g_strfreev(firstRegex);
g_strfreev(secondRegex);
VIR_FREE(uuid);
VIR_FREE(timeStamp);
return result;
@ -730,7 +730,7 @@ virVBoxSnapshotConfLoadVboxFile(const char *filePath,
VIR_FREE(currentStateModifiedString);
VIR_FREE(currentSnapshotAttribute);
virStringListFree(searchResultTab);
g_strfreev(searchResultTab);
if (ret < 0) {
virVBoxSnapshotConfMachineFree(machineDescription);
machineDescription = NULL;
@ -1211,8 +1211,8 @@ virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine,
xmlFreeDoc(xml);
virStringListFree(firstRegex);
virStringListFree(secondRegex);
g_strfreev(firstRegex);
g_strfreev(secondRegex);
return ret;
}
@ -1297,7 +1297,7 @@ virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(const char *filePath,
xmlFreeDoc(xml);
xmlXPathFreeContext(xPathContext);
if (result < 0) {
virStringListFree(ret);
g_strfreev(ret);
nodeSize = -1;
} else {
*rwDisksPath = ret;
@ -1358,7 +1358,7 @@ virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(const char *filePath,
xmlFreeDoc(xml);
xmlXPathFreeContext(xPathContext);
if (result < 0) {
virStringListFree(ret);
g_strfreev(ret);
nodeSize = -1;
} else {
*roDisksPath = ret;

View File

@ -1600,7 +1600,7 @@ _vrdeServerGetPorts(vboxDriverPtr data, IVRDEServer *VRDEServer,
}
cleanup:
virStringListFree(matches);
g_strfreev(matches);
VBOX_UTF8_FREE(portUtf8);
VBOX_UTF16_FREE(VRDEPortsValue);
VBOX_UTF16_FREE(VRDEPortsKey);

View File

@ -796,7 +796,7 @@ prlsdkGetFSInfo(PRL_HANDLE prldisk,
cleanup:
VIR_FREE(buf);
virStringListFree(matches);
g_strfreev(matches);
return ret;
}

View File

@ -611,7 +611,7 @@ testQemuMonitorJSONGetTPMModels(const void *opaque)
ret = 0;
cleanup:
virStringListFree(tpmmodels);
g_strfreev(tpmmodels);
return ret;
}
@ -672,7 +672,7 @@ testQemuMonitorJSONGetCommandLineOptionParameters(const void *opaque)
#undef CHECK
virStringListFree(params);
g_strfreev(params);
params = NULL;
/* present but empty */
@ -698,7 +698,7 @@ testQemuMonitorJSONGetCommandLineOptionParameters(const void *opaque)
goto cleanup;
}
virStringListFree(params);
g_strfreev(params);
params = NULL;
/* no such option */
@ -727,7 +727,7 @@ testQemuMonitorJSONGetCommandLineOptionParameters(const void *opaque)
ret = 0;
cleanup:
virStringListFree(params);
g_strfreev(params);
return ret;
}
@ -1186,7 +1186,7 @@ testQemuMonitorJSONGetDeviceAliases(const void *opaque)
}
cleanup:
virStringListFree(aliases);
g_strfreev(aliases);
return ret;
}
@ -2269,7 +2269,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *opaque)
cleanup:
virJSONValueFree(json);
virStringListFree(caps);
g_strfreev(caps);
virBitmapFree(bitmap);
return ret;
}

View File

@ -39,7 +39,7 @@ testFilterXML(char *xml)
ret = virBufferContentAndReset(&buf);
cleanup:
virStringListFree(xmlLines);
g_strfreev(xmlLines);
return ret;
}

View File

@ -441,7 +441,7 @@ static int testConfParseStringList(const void *opaque G_GNUC_UNUSED)
ret = 0;
cleanup:
virStringListFree(str);
g_strfreev(str);
return ret;
}

View File

@ -88,7 +88,7 @@ static int testFileGetMountSubtree(const void *opaque)
data->mounts, data->nmounts);
cleanup:
virStringListFree(gotmounts);
g_strfreev(gotmounts);
return ret;
}
#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */

View File

@ -134,7 +134,7 @@ static int testSplit(const void *args)
ret = 0;
cleanup:
virStringListFree(got);
g_strfreev(got);
return ret;
}
@ -192,7 +192,7 @@ static int testAdd(const void *args)
ret = 0;
cleanup:
virStringListFree(list);
g_strfreev(list);
VIR_FREE(got);
return ret;
}
@ -227,7 +227,7 @@ static int testRemove(const void *args)
ret = 0;
cleanup:
virStringListFree(list);
g_strfreev(list);
return ret;
}
@ -331,7 +331,7 @@ testStringSearch(const void *opaque)
ret = 0;
cleanup:
virStringListFree(matches);
g_strfreev(matches);
return ret;
}

View File

@ -185,7 +185,7 @@ virshParseCheckpointDiskspec(vshControl *ctl,
cleanup:
if (ret < 0)
vshError(ctl, _("unable to parse diskspec: %s"), str);
virStringListFree(array);
g_strfreev(array);
return ret;
}

View File

@ -883,7 +883,7 @@ virshParseRateStr(vshControl *ctl,
ret = 0;
cleanup:
virStringListFree(tok);
g_strfreev(tok);
return ret;
}
@ -4081,14 +4081,14 @@ cmdStartGetFDs(vshControl *ctl,
fds[nfds - 1] = fd;
}
virStringListFree(fdlist);
g_strfreev(fdlist);
*fdsret = fds;
*nfdsret = nfds;
return 0;
error:
virStringListFree(fdlist);
g_strfreev(fdlist);
VIR_FREE(fds);
return -1;
}
@ -5974,7 +5974,7 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
virshDomainFree(dom);
virStringListFree(modes);
g_strfreev(modes);
return ret;
}
@ -6054,7 +6054,7 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
virshDomainFree(dom);
virStringListFree(modes);
g_strfreev(modes);
return ret;
}
@ -9360,7 +9360,7 @@ virshParseEventStr(const char *event,
ret = 0;
cleanup:
virStringListFree(tok);
g_strfreev(tok);
return ret;
}

View File

@ -1190,7 +1190,7 @@ vshExtractCPUDefXMLs(vshControl *ctl,
return cpus;
error:
virStringListFree(cpus);
g_strfreev(cpus);
goto cleanup;
}
@ -1264,7 +1264,7 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
virStringListFree(cpus);
g_strfreev(cpus);
return ret;
}
@ -1326,7 +1326,7 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd)
}
VIR_FREE(result);
virStringListFree(list);
g_strfreev(list);
return ret;
}
@ -1702,7 +1702,7 @@ cmdHypervisorCPUCompare(vshControl *ctl,
ret = true;
cleanup:
virStringListFree(cpus);
g_strfreev(cpus);
return ret;
}
@ -1792,7 +1792,7 @@ cmdHypervisorCPUBaseline(vshControl *ctl,
}
VIR_FREE(result);
virStringListFree(list);
g_strfreev(list);
return ret;
}

View File

@ -153,7 +153,7 @@ cmdNodeDeviceDestroy(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
virStringListFree(arr);
g_strfreev(arr);
if (dev)
virNodeDeviceFree(dev);
return ret;
@ -507,7 +507,7 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
}
cleanup:
virStringListFree(caps);
g_strfreev(caps);
virshNodeDeviceListFree(list);
return ret;
}
@ -577,7 +577,7 @@ cmdNodeDeviceDumpXML(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
virStringListFree(arr);
g_strfreev(arr);
VIR_FREE(xml);
if (device)
virNodeDeviceFree(device);

View File

@ -1175,7 +1175,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
for (i = 0; i < npoolTypes; i++) {
if ((poolType = virStoragePoolTypeFromString(poolTypes[i])) < 0) {
vshError(ctl, _("Invalid pool type '%s'"), poolTypes[i]);
virStringListFree(poolTypes);
g_strfreev(poolTypes);
return false;
}
@ -1226,7 +1226,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
break;
}
}
virStringListFree(poolTypes);
g_strfreev(poolTypes);
}
if (!(list = virshStoragePoolListCollect(ctl, flags)))

View File

@ -251,7 +251,7 @@ virshParseSnapshotMemspec(vshControl *ctl, virBufferPtr buf, const char *str)
cleanup:
if (ret < 0)
vshError(ctl, _("unable to parse memspec: %s"), str);
virStringListFree(array);
g_strfreev(array);
return ret;
}
@ -319,7 +319,7 @@ virshParseSnapshotDiskspec(vshControl *ctl, virBufferPtr buf, const char *str)
cleanup:
if (ret < 0)
vshError(ctl, _("unable to parse diskspec: %s"), str);
virStringListFree(array);
g_strfreev(array);
return ret;
}

View File

@ -84,7 +84,7 @@ static int virLoginShellAllowedUser(virConfPtr conf,
name, conf_file);
cleanup:
VIR_FREE(gname);
virStringListFree(users);
g_strfreev(users);
return ret;
}
@ -329,7 +329,7 @@ main(int argc, char **argv)
if (autoshell) {
tmp = virGetUserShell(uid);
if (tmp) {
virStringListFree(shargv);
g_strfreev(shargv);
shargvlen = 1;
if (VIR_ALLOC_N(shargv[0], shargvlen + 1) < 0) {
VIR_FREE(tmp);
@ -410,7 +410,7 @@ main(int argc, char **argv)
virDomainFree(dom);
if (conn)
virConnectClose(conn);
virStringListFree(shargv);
g_strfreev(shargv);
VIR_FREE(shcmd);
VIR_FREE(term);
VIR_FREE(name);

View File

@ -2582,7 +2582,7 @@ vshReadlineCommandGenerator(const char *text)
if (STREQLEN(name, text, len)) {
if (VIR_REALLOC_N(ret, ret_size + 2) < 0) {
virStringListFree(ret);
g_strfreev(ret);
return NULL;
}
ret[ret_size] = g_strdup(name);
@ -2647,7 +2647,7 @@ vshReadlineOptionsGenerator(const char *text,
continue;
if (VIR_REALLOC_N(ret, ret_size + 2) < 0) {
virStringListFree(ret);
g_strfreev(ret);
return NULL;
}
@ -2741,7 +2741,7 @@ vshReadlineParse(const char *text, int state)
vshCommandFree(partial);
partial = NULL;
virStringListFree(list);
g_strfreev(list);
list = NULL;
list_index = 0;
@ -2791,7 +2791,7 @@ vshReadlineParse(const char *text, int state)
if (completer_list &&
(vshCompleterFilter(&completer_list, text) < 0 ||
virStringListMerge(&list, &completer_list) < 0)) {
virStringListFree(completer_list);
g_strfreev(completer_list);
goto cleanup;
}
}
@ -2815,7 +2815,7 @@ vshReadlineParse(const char *text, int state)
if (!ret) {
vshCommandFree(partial);
partial = NULL;
virStringListFree(list);
g_strfreev(list);
list = NULL;
list_index = 0;
}
@ -3405,7 +3405,7 @@ cmdComplete(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
virStringListFree(matches);
g_strfreev(matches);
return ret;
}