mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
network: use g_free() in place of remaining VIR_FREE()
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f931c85fb0
commit
cab4a682de
@ -158,7 +158,7 @@ networkDnsmasqDefNamespaceFree(void *nsdata)
|
|||||||
|
|
||||||
virStringListFreeCount(def->options, def->noptions);
|
virStringListFreeCount(def->options, def->noptions);
|
||||||
|
|
||||||
VIR_FREE(def);
|
g_free(def);
|
||||||
}
|
}
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(networkDnsmasqXmlNsDef, networkDnsmasqDefNamespaceFree);
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(networkDnsmasqXmlNsDef, networkDnsmasqDefNamespaceFree);
|
||||||
|
|
||||||
@ -707,7 +707,7 @@ networkStateInitialize(bool privileged,
|
|||||||
|
|
||||||
network_driver->lockFD = -1;
|
network_driver->lockFD = -1;
|
||||||
if (virMutexInit(&network_driver->lock) < 0) {
|
if (virMutexInit(&network_driver->lock) < 0) {
|
||||||
VIR_FREE(network_driver);
|
g_clear_pointer(&network_driver, g_free);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -875,18 +875,18 @@ networkStateCleanup(void)
|
|||||||
virPidFileRelease(network_driver->stateDir, "driver",
|
virPidFileRelease(network_driver->stateDir, "driver",
|
||||||
network_driver->lockFD);
|
network_driver->lockFD);
|
||||||
|
|
||||||
VIR_FREE(network_driver->networkConfigDir);
|
g_free(network_driver->networkConfigDir);
|
||||||
VIR_FREE(network_driver->networkAutostartDir);
|
g_free(network_driver->networkAutostartDir);
|
||||||
VIR_FREE(network_driver->stateDir);
|
g_free(network_driver->stateDir);
|
||||||
VIR_FREE(network_driver->pidDir);
|
g_free(network_driver->pidDir);
|
||||||
VIR_FREE(network_driver->dnsmasqStateDir);
|
g_free(network_driver->dnsmasqStateDir);
|
||||||
VIR_FREE(network_driver->radvdStateDir);
|
g_free(network_driver->radvdStateDir);
|
||||||
|
|
||||||
virObjectUnref(network_driver->dnsmasqCaps);
|
virObjectUnref(network_driver->dnsmasqCaps);
|
||||||
|
|
||||||
virMutexDestroy(&network_driver->lock);
|
virMutexDestroy(&network_driver->lock);
|
||||||
|
|
||||||
VIR_FREE(network_driver);
|
g_clear_pointer(&network_driver, g_free);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2718,19 +2718,19 @@ networkCreateInterfacePool(virNetworkDefPtr netdef)
|
|||||||
for (i = 0; i < netdef->forward.nifs; i++) {
|
for (i = 0; i < netdef->forward.nifs; i++) {
|
||||||
if (netdef->forward.ifs[i].type
|
if (netdef->forward.ifs[i].type
|
||||||
== VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV)
|
== VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV)
|
||||||
VIR_FREE(netdef->forward.ifs[i].device.dev);
|
g_free(netdef->forward.ifs[i].device.dev);
|
||||||
}
|
}
|
||||||
netdef->forward.nifs = 0;
|
netdef->forward.nifs = 0;
|
||||||
}
|
}
|
||||||
if (netdef->forward.nifs == 0)
|
if (netdef->forward.nifs == 0)
|
||||||
VIR_FREE(netdef->forward.ifs);
|
g_clear_pointer(&netdef->forward.ifs, g_free);
|
||||||
|
|
||||||
for (i = 0; i < numVirtFns; i++) {
|
for (i = 0; i < numVirtFns; i++) {
|
||||||
VIR_FREE(vfNames[i]);
|
g_free(vfNames[i]);
|
||||||
VIR_FREE(virtFns[i]);
|
g_free(virtFns[i]);
|
||||||
}
|
}
|
||||||
VIR_FREE(vfNames);
|
g_free(vfNames);
|
||||||
VIR_FREE(virtFns);
|
g_free(virtFns);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3166,7 +3166,7 @@ networkFindUnusedBridgeName(virNetworkObjListPtr nets,
|
|||||||
*/
|
*/
|
||||||
if (!(virNetworkObjBridgeInUse(nets, newname, def->name) ||
|
if (!(virNetworkObjBridgeInUse(nets, newname, def->name) ||
|
||||||
virNetDevExists(newname) == 1)) {
|
virNetDevExists(newname) == 1)) {
|
||||||
VIR_FREE(def->bridge); /*could contain template */
|
g_free(def->bridge); /*could contain template */
|
||||||
def->bridge = g_steal_pointer(&newname);
|
def->bridge = g_steal_pointer(&newname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -4276,7 +4276,7 @@ networkGetDHCPLeases(virNetworkPtr net,
|
|||||||
if (leases_ret) {
|
if (leases_ret) {
|
||||||
for (i = 0; i < nleases; i++)
|
for (i = 0; i < nleases; i++)
|
||||||
virNetworkDHCPLeaseFree(leases_ret[i]);
|
virNetworkDHCPLeaseFree(leases_ret[i]);
|
||||||
VIR_FREE(leases_ret);
|
g_free(leases_ret);
|
||||||
}
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -4400,7 +4400,7 @@ networkAllocatePort(virNetworkObjPtr obj,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (portprofile) {
|
if (portprofile) {
|
||||||
VIR_FREE(port->virtPortProfile);
|
g_free(port->virtPortProfile);
|
||||||
port->virtPortProfile = portprofile;
|
port->virtPortProfile = portprofile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5517,9 +5517,10 @@ networkPortSetParameters(virNetworkPortPtr port,
|
|||||||
* So if no average or floor is given, we free inbound/outbound
|
* So if no average or floor is given, we free inbound/outbound
|
||||||
* here which causes inbound/outbound to not be set. */
|
* here which causes inbound/outbound to not be set. */
|
||||||
if (!bandwidth->in->average && !bandwidth->in->floor)
|
if (!bandwidth->in->average && !bandwidth->in->floor)
|
||||||
VIR_FREE(bandwidth->in);
|
g_clear_pointer(&bandwidth->in, g_free);
|
||||||
|
|
||||||
if (!bandwidth->out->average)
|
if (!bandwidth->out->average)
|
||||||
VIR_FREE(bandwidth->out);
|
g_clear_pointer(&bandwidth->out, g_free);
|
||||||
|
|
||||||
if (networkUpdatePortBandwidth(obj,
|
if (networkUpdatePortBandwidth(obj,
|
||||||
&portdef->mac,
|
&portdef->mac,
|
||||||
|
Loading…
Reference in New Issue
Block a user