]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nwfilter: remove unnecessary code from ebtablesGetSubChainInsts()
authorLaine Stump <laine@redhat.com>
Wed, 24 Jun 2020 23:31:55 +0000 (19:31 -0400)
committerLaine Stump <laine@redhat.com>
Mon, 20 Jul 2020 23:13:05 +0000 (19:13 -0400)
On failure, this function would clear out and free the list of
subchains it had been called with. This is unnecessary, because the
*only* caller of this function will also clear out and free the list
of subchains if it gets a failure from ebtablesGetSubChainInsts().

(It also makes more logical sense for the function that is creating
the entire list to be the one freeing the entire list, rather than
having a function whose purpose is only to create *one item* on the
list freeing the entire list).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko redhat com>
src/nwfilter/nwfilter_ebiptables_driver.c

index 78a52408b29f9ac5f8574bc6cd33982f6330c506..426212e0dc7abaab60f1b8cee6a83eabe0cc974a 100644 (file)
@@ -3328,12 +3328,6 @@ ebtablesGetSubChainInsts(virHashTablePtr chains,
 
  cleanup:
     VIR_FREE(filter_names);
-    if (ret < 0) {
-        for (i = 0; i < *ninsts; i++)
-            VIR_FREE(*insts[i]);
-        VIR_FREE(*insts);
-        *ninsts = 0;
-    }
     return ret;
 
 }