lib: Don't set variable to NULL after VIR_FREE()

There are a few places where a variable is VIR_FREE()-d and then
explicitly set to NULL. This is not necessary since VIR_FREE()
does that for us.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-28 18:22:06 +01:00
parent 726b9616b2
commit ce880ad8ba
3 changed files with 0 additions and 3 deletions

View File

@ -12746,7 +12746,6 @@ virDomainGraphicsDefNew(virDomainXMLOption *xmlopt)
if (xmlopt && xmlopt->privateData.graphicsNew &&
!(def->privateData = xmlopt->privateData.graphicsNew())) {
VIR_FREE(def);
def = NULL;
}
return def;

View File

@ -1813,7 +1813,6 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
if (match && STREQ(match, "no"))
match_flag = NWFILTER_ENTRY_ITEM_FLAG_IS_NEG;
VIR_FREE(match);
match = NULL;
while (att[idx].name != NULL) {
prop = virXMLPropString(node, att[idx].name);

View File

@ -106,7 +106,6 @@ testTypedParamsFilter(const void *opaque G_GNUC_UNUSED)
goto cleanup;
}
VIR_FREE(filtered);
filtered = NULL;
nfiltered = virTypedParamsFilter(params, G_N_ELEMENTS(params),
"bar", &filtered);