[libvirt PATCH v2 08/15] nwfilter: remove unnecessary code from ebtablesGetSubChainInsts()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/nwfilter/nwfilter_ebiptables_driver.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index 78a52408b2..426212e0dc 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -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;
 
 }
-- 
2.25.4




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux