[PATCH 14/33] virfirewall: Remove OOM checks from virFirewallStartTransaction

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

 



Neither virFirewallGroupNew nor VIR_EXPAND_N can fail.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virfirewall.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index 95962568f5..66b33d4a91 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -517,18 +517,11 @@ void virFirewallStartTransaction(virFirewallPtr firewall,

     VIR_FIREWALL_RETURN_IF_ERROR(firewall);

-    if (!(group = virFirewallGroupNew())) {
-        firewall->err = ENOMEM;
-        return;
-    }
+    group = virFirewallGroupNew();
     group->actionFlags = flags;

-    if (VIR_EXPAND_N(firewall->groups,
-                     firewall->ngroups, 1) < 0) {
-        firewall->err = ENOMEM;
-        virFirewallGroupFree(group);
-        return;
-    }
+    ignore_value(VIR_EXPAND_N(firewall->groups,
+                              firewall->ngroups, 1));
     firewall->groups[firewall->ngroups - 1] = group;
     firewall->currentGroup = firewall->ngroups - 1;
 }
-- 
2.29.2




[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