mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
726b9616b2
commit
ce880ad8ba
@ -12746,7 +12746,6 @@ virDomainGraphicsDefNew(virDomainXMLOption *xmlopt)
|
|||||||
if (xmlopt && xmlopt->privateData.graphicsNew &&
|
if (xmlopt && xmlopt->privateData.graphicsNew &&
|
||||||
!(def->privateData = xmlopt->privateData.graphicsNew())) {
|
!(def->privateData = xmlopt->privateData.graphicsNew())) {
|
||||||
VIR_FREE(def);
|
VIR_FREE(def);
|
||||||
def = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return def;
|
return def;
|
||||||
|
@ -1813,7 +1813,6 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
|
|||||||
if (match && STREQ(match, "no"))
|
if (match && STREQ(match, "no"))
|
||||||
match_flag = NWFILTER_ENTRY_ITEM_FLAG_IS_NEG;
|
match_flag = NWFILTER_ENTRY_ITEM_FLAG_IS_NEG;
|
||||||
VIR_FREE(match);
|
VIR_FREE(match);
|
||||||
match = NULL;
|
|
||||||
|
|
||||||
while (att[idx].name != NULL) {
|
while (att[idx].name != NULL) {
|
||||||
prop = virXMLPropString(node, att[idx].name);
|
prop = virXMLPropString(node, att[idx].name);
|
||||||
|
@ -106,7 +106,6 @@ testTypedParamsFilter(const void *opaque G_GNUC_UNUSED)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
VIR_FREE(filtered);
|
VIR_FREE(filtered);
|
||||||
filtered = NULL;
|
|
||||||
|
|
||||||
nfiltered = virTypedParamsFilter(params, G_N_ELEMENTS(params),
|
nfiltered = virTypedParamsFilter(params, G_N_ELEMENTS(params),
|
||||||
"bar", &filtered);
|
"bar", &filtered);
|
||||||
|
Loading…
Reference in New Issue
Block a user