[PATCH 13/33] virfirewall: Don't check OOM in ADD_ARG macro

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

 



VIR_RESIZE_N can't fail nowadays, adjust the macro.

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

diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index 6b04a8011f..95962568f5 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -262,10 +262,9 @@ void virFirewallFree(virFirewallPtr firewall)

 #define ADD_ARG(rule, str) \
     do { \
-        if (VIR_RESIZE_N(rule->args, \
-                         rule->argsAlloc, \
-                         rule->argsLen, 1) < 0) \
-            goto no_memory; \
+        ignore_value(VIR_RESIZE_N(rule->args, \
+                                  rule->argsAlloc, \
+                                  rule->argsLen, 1)); \
  \
         rule->args[rule->argsLen++] = g_strdup(str); \
     } while (0)
@@ -433,9 +432,6 @@ void virFirewallRuleAddArg(virFirewallPtr firewall,
     ADD_ARG(rule, arg);

     return;
-
- no_memory:
-    firewall->err = ENOMEM;
 }


@@ -455,9 +451,6 @@ void virFirewallRuleAddArgFormat(virFirewallPtr firewall,
     ADD_ARG(rule, arg);

     return;
-
- no_memory:
-    firewall->err = ENOMEM;
 }


@@ -473,9 +466,6 @@ void virFirewallRuleAddArgSet(virFirewallPtr firewall,
     }

     return;
-
- no_memory:
-    firewall->err = ENOMEM;
 }


@@ -496,10 +486,6 @@ void virFirewallRuleAddArgList(virFirewallPtr firewall,
     va_end(list);

     return;
-
- no_memory:
-    firewall->err = ENOMEM;
-    va_end(list);
 }


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