mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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:
parent
1a1a926804
commit
2a620b1200
@ -315,24 +315,17 @@ virFirewallAddRuleFullV(virFirewallPtr firewall,
|
||||
ADD_ARG(rule, str);
|
||||
|
||||
if (group->addingRollback) {
|
||||
if (VIR_APPEND_ELEMENT_COPY(group->rollback,
|
||||
ignore_value(VIR_APPEND_ELEMENT_COPY(group->rollback,
|
||||
group->nrollback,
|
||||
rule) < 0)
|
||||
goto no_memory;
|
||||
rule));
|
||||
} else {
|
||||
if (VIR_APPEND_ELEMENT_COPY(group->action,
|
||||
ignore_value(VIR_APPEND_ELEMENT_COPY(group->action,
|
||||
group->naction,
|
||||
rule) < 0)
|
||||
goto no_memory;
|
||||
rule));
|
||||
}
|
||||
|
||||
|
||||
return rule;
|
||||
|
||||
no_memory:
|
||||
firewall->err = ENOMEM;
|
||||
virFirewallRuleFree(rule);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user