]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lib: Don't set variable to NULL after VIR_FREE()
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 28 Jan 2022 17:22:06 +0000 (18:22 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Feb 2022 16:37:06 +0000 (17:37 +0100)
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>
src/conf/domain_conf.c
src/conf/nwfilter_conf.c
tests/virtypedparamtest.c

index 58e696416dc694c9284585b0a49ab8dff09eb65f..e931aef6c40010d8b2423def41a4dd1c07c5c833 100644 (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;
index 3fedfdde56b6132405cdac68261e0a37747a6cb6..c886218dde7c26e2a721d52fd4c0c630de0a47b9 100644 (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);
index 87b47ba86ed59d63d20f2aef8f78cb7c58abe179..5ced453be5f2e7533bba64e123b7ad9db1fb7a31 100644 (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);