[PATCH 15/33] virfirewall: virFirewallAddRuleFullV: Remove OOM check from VIR_APPEND_ELEMENT

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

 



VIR_APPEND_ELEMENT_COPY will abort the program on OOM so there's no need
to check.

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

diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index 66b33d4a91..bbeb87e72d 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -315,24 +315,17 @@ virFirewallAddRuleFullV(virFirewallPtr firewall,
         ADD_ARG(rule, str);

     if (group->addingRollback) {
-        if (VIR_APPEND_ELEMENT_COPY(group->rollback,
-                                    group->nrollback,
-                                    rule) < 0)
-            goto no_memory;
+        ignore_value(VIR_APPEND_ELEMENT_COPY(group->rollback,
+                                             group->nrollback,
+                                             rule));
     } else {
-        if (VIR_APPEND_ELEMENT_COPY(group->action,
-                                    group->naction,
-                                    rule) < 0)
-            goto no_memory;
+        ignore_value(VIR_APPEND_ELEMENT_COPY(group->action,
+                                             group->naction,
+                                             rule));
     }


     return rule;
-
- no_memory:
-    firewall->err = ENOMEM;
-    virFirewallRuleFree(rule);
-    return NULL;
 }


-- 
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