Neither virFirewallGroupNew nor VIR_EXPAND_N can fail.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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