virfirewall: virFirewallAddRuleFullV: Remove OOM check from VIR_APPEND_ELEMENT

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Peter Krempa 2021-02-23 17:38:18 +01:00
parent 1a1a926804
commit 2a620b1200

View File

@ -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;
}