mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
nwfilter: convert remaining VIR_FREE() to g_free()
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
fae0a0e5a4
commit
bb4e0596d9
@ -314,7 +314,7 @@ virNWFilterSnoopCancel(char **threadKey)
|
|||||||
virNWFilterSnoopActiveLock();
|
virNWFilterSnoopActiveLock();
|
||||||
|
|
||||||
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.active, *threadKey));
|
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.active, *threadKey));
|
||||||
VIR_FREE(*threadKey);
|
g_clear_pointer(threadKey, g_free);
|
||||||
|
|
||||||
virNWFilterSnoopActiveUnlock();
|
virNWFilterSnoopActiveUnlock();
|
||||||
}
|
}
|
||||||
@ -600,7 +600,7 @@ virNWFilterSnoopReqFree(virNWFilterSnoopReqPtr req)
|
|||||||
virCondDestroy(&req->threadStatusCond);
|
virCondDestroy(&req->threadStatusCond);
|
||||||
virFreeError(req->threadError);
|
virFreeError(req->threadError);
|
||||||
|
|
||||||
VIR_FREE(req);
|
g_free(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -731,7 +731,7 @@ virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReqPtr req,
|
|||||||
|
|
||||||
if (req->threadkey && virNWFilterSnoopIPLeaseInstallRule(pl, true) < 0) {
|
if (req->threadkey && virNWFilterSnoopIPLeaseInstallRule(pl, true) < 0) {
|
||||||
virNWFilterSnoopReqUnlock(req);
|
virNWFilterSnoopReqUnlock(req);
|
||||||
VIR_FREE(pl);
|
g_free(pl);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
|
|||||||
}
|
}
|
||||||
|
|
||||||
skip_instantiate:
|
skip_instantiate:
|
||||||
VIR_FREE(ipl);
|
g_free(ipl);
|
||||||
|
|
||||||
ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLeases));
|
ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLeases));
|
||||||
|
|
||||||
@ -1149,7 +1149,7 @@ virNWFilterSnoopDHCPDecodeJobSubmit(virThreadPoolPtr pool,
|
|||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
g_atomic_int_add(qCtr, 1);
|
g_atomic_int_add(qCtr, 1);
|
||||||
else
|
else
|
||||||
VIR_FREE(job);
|
g_free(job);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1502,7 +1502,7 @@ virNWFilterDHCPSnoopThread(void *req0)
|
|||||||
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
|
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
|
||||||
req->binding->portdevname));
|
req->binding->portdevname));
|
||||||
|
|
||||||
VIR_FREE(req->binding->portdevname);
|
g_clear_pointer(&req->binding->portdevname, g_free);
|
||||||
|
|
||||||
virNWFilterSnoopReqUnlock(req);
|
virNWFilterSnoopReqUnlock(req);
|
||||||
virNWFilterSnoopUnlock();
|
virNWFilterSnoopUnlock();
|
||||||
@ -1970,7 +1970,7 @@ virNWFilterSnoopRemAllReqIter(const void *payload,
|
|||||||
*/
|
*/
|
||||||
virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, NULL);
|
virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, NULL);
|
||||||
|
|
||||||
VIR_FREE(req->binding->portdevname);
|
g_clear_pointer(&req->binding->portdevname, g_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
virNWFilterSnoopReqUnlock(req);
|
virNWFilterSnoopReqUnlock(req);
|
||||||
@ -2079,7 +2079,7 @@ virNWFilterDHCPSnoopEnd(const char *ifname)
|
|||||||
/* keep valid lease req; drop interface association */
|
/* keep valid lease req; drop interface association */
|
||||||
virNWFilterSnoopCancel(&req->threadkey);
|
virNWFilterSnoopCancel(&req->threadkey);
|
||||||
|
|
||||||
VIR_FREE(req->binding->portdevname);
|
g_clear_pointer(&req->binding->portdevname, g_free);
|
||||||
|
|
||||||
virNWFilterSnoopReqUnlock(req);
|
virNWFilterSnoopReqUnlock(req);
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ nwfilterStateInitialize(bool privileged,
|
|||||||
|
|
||||||
err_free_driverstate:
|
err_free_driverstate:
|
||||||
virNWFilterObjListFree(driver->nwfilters);
|
virNWFilterObjListFree(driver->nwfilters);
|
||||||
VIR_FREE(driver);
|
g_clear_pointer(&driver, g_free);
|
||||||
|
|
||||||
return VIR_DRV_STATE_INIT_ERROR;
|
return VIR_DRV_STATE_INIT_ERROR;
|
||||||
}
|
}
|
||||||
@ -367,9 +367,9 @@ nwfilterStateCleanup(void)
|
|||||||
if (driver->lockFD != -1)
|
if (driver->lockFD != -1)
|
||||||
virPidFileRelease(driver->stateDir, "driver", driver->lockFD);
|
virPidFileRelease(driver->stateDir, "driver", driver->lockFD);
|
||||||
|
|
||||||
VIR_FREE(driver->stateDir);
|
g_free(driver->stateDir);
|
||||||
VIR_FREE(driver->configDir);
|
g_free(driver->configDir);
|
||||||
VIR_FREE(driver->bindingDir);
|
g_free(driver->bindingDir);
|
||||||
nwfilterDriverUnlock();
|
nwfilterDriverUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ nwfilterStateCleanup(void)
|
|||||||
virNWFilterObjListFree(driver->nwfilters);
|
virNWFilterObjListFree(driver->nwfilters);
|
||||||
|
|
||||||
virMutexDestroy(&driver->lock);
|
virMutexDestroy(&driver->lock);
|
||||||
VIR_FREE(driver);
|
g_clear_pointer(&driver, g_free);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3517,7 +3517,7 @@ ebiptablesApplyNewRules(const char *ifname,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nsubchains; i++)
|
for (i = 0; i < nsubchains; i++)
|
||||||
VIR_FREE(subchains[i]);
|
g_free(subchains[i]);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
virHashFree(inst->vars);
|
virHashFree(inst->vars);
|
||||||
VIR_FREE(inst);
|
g_free(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -234,12 +234,12 @@ virNWFilterInstReset(virNWFilterInstPtr inst)
|
|||||||
|
|
||||||
for (i = 0; i < inst->nfilters; i++)
|
for (i = 0; i < inst->nfilters; i++)
|
||||||
virNWFilterObjUnlock(inst->filters[i]);
|
virNWFilterObjUnlock(inst->filters[i]);
|
||||||
VIR_FREE(inst->filters);
|
g_free(inst->filters);
|
||||||
inst->nfilters = 0;
|
inst->nfilters = 0;
|
||||||
|
|
||||||
for (i = 0; i < inst->nrules; i++)
|
for (i = 0; i < inst->nrules; i++)
|
||||||
virNWFilterRuleInstFree(inst->rules[i]);
|
virNWFilterRuleInstFree(inst->rules[i]);
|
||||||
VIR_FREE(inst->rules);
|
g_free(inst->rules);
|
||||||
inst->nrules = 0;
|
inst->nrules = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ virNWFilterLockIface(const char *ifname)
|
|||||||
if (virMutexInitRecursive(&ifaceLock->lock) < 0) {
|
if (virMutexInitRecursive(&ifaceLock->lock) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("mutex initialization failed"));
|
_("mutex initialization failed"));
|
||||||
VIR_FREE(ifaceLock);
|
g_free(ifaceLock);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,12 +165,12 @@ virNWFilterLockIface(const char *ifname)
|
|||||||
_("interface name %s does not fit into "
|
_("interface name %s does not fit into "
|
||||||
"buffer "),
|
"buffer "),
|
||||||
ifaceLock->ifname);
|
ifaceLock->ifname);
|
||||||
VIR_FREE(ifaceLock);
|
g_free(ifaceLock);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (virHashAddEntry(ifaceLockMap, ifname, ifaceLock)) {
|
while (virHashAddEntry(ifaceLockMap, ifname, ifaceLock)) {
|
||||||
VIR_FREE(ifaceLock);
|
g_free(ifaceLock);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReqPtr req)
|
|||||||
|
|
||||||
virNWFilterBindingDefFree(req->binding);
|
virNWFilterBindingDefFree(req->binding);
|
||||||
|
|
||||||
VIR_FREE(req);
|
g_free(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user