virNWFilterSnoopActiveLock();
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.active, *threadKey));
- VIR_FREE(*threadKey);
+ g_clear_pointer(threadKey, g_free);
virNWFilterSnoopActiveUnlock();
}
virCondDestroy(&req->threadStatusCond);
virFreeError(req->threadError);
- VIR_FREE(req);
+ g_free(req);
}
/*
if (req->threadkey && virNWFilterSnoopIPLeaseInstallRule(pl, true) < 0) {
virNWFilterSnoopReqUnlock(req);
- VIR_FREE(pl);
+ g_free(pl);
return -1;
}
}
skip_instantiate:
- VIR_FREE(ipl);
+ g_free(ipl);
ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLeases));
if (ret == 0)
g_atomic_int_add(qCtr, 1);
else
- VIR_FREE(job);
+ g_free(job);
return ret;
}
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
req->binding->portdevname));
- VIR_FREE(req->binding->portdevname);
+ g_clear_pointer(&req->binding->portdevname, g_free);
virNWFilterSnoopReqUnlock(req);
virNWFilterSnoopUnlock();
*/
virNWFilterIPAddrMapDelIPAddr(req->binding->portdevname, NULL);
- VIR_FREE(req->binding->portdevname);
+ g_clear_pointer(&req->binding->portdevname, g_free);
}
virNWFilterSnoopReqUnlock(req);
/* keep valid lease req; drop interface association */
virNWFilterSnoopCancel(&req->threadkey);
- VIR_FREE(req->binding->portdevname);
+ g_clear_pointer(&req->binding->portdevname, g_free);
virNWFilterSnoopReqUnlock(req);
err_free_driverstate:
virNWFilterObjListFree(driver->nwfilters);
- VIR_FREE(driver);
+ g_clear_pointer(&driver, g_free);
return VIR_DRV_STATE_INIT_ERROR;
}
if (driver->lockFD != -1)
virPidFileRelease(driver->stateDir, "driver", driver->lockFD);
- VIR_FREE(driver->stateDir);
- VIR_FREE(driver->configDir);
- VIR_FREE(driver->bindingDir);
+ g_free(driver->stateDir);
+ g_free(driver->configDir);
+ g_free(driver->bindingDir);
nwfilterDriverUnlock();
}
virNWFilterObjListFree(driver->nwfilters);
virMutexDestroy(&driver->lock);
- VIR_FREE(driver);
+ g_clear_pointer(&driver, g_free);
return 0;
}
if (virMutexInitRecursive(&ifaceLock->lock) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("mutex initialization failed"));
- VIR_FREE(ifaceLock);
+ g_free(ifaceLock);
goto error;
}
_("interface name %s does not fit into "
"buffer "),
ifaceLock->ifname);
- VIR_FREE(ifaceLock);
+ g_free(ifaceLock);
goto error;
}
while (virHashAddEntry(ifaceLockMap, ifname, ifaceLock)) {
- VIR_FREE(ifaceLock);
+ g_free(ifaceLock);
goto error;
}
virNWFilterBindingDefFree(req->binding);
- VIR_FREE(req);
+ g_free(req);
}