mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +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);
|
ADD_ARG(rule, str);
|
||||||
|
|
||||||
if (group->addingRollback) {
|
if (group->addingRollback) {
|
||||||
if (VIR_APPEND_ELEMENT_COPY(group->rollback,
|
ignore_value(VIR_APPEND_ELEMENT_COPY(group->rollback,
|
||||||
group->nrollback,
|
group->nrollback,
|
||||||
rule) < 0)
|
rule));
|
||||||
goto no_memory;
|
|
||||||
} else {
|
} else {
|
||||||
if (VIR_APPEND_ELEMENT_COPY(group->action,
|
ignore_value(VIR_APPEND_ELEMENT_COPY(group->action,
|
||||||
group->naction,
|
group->naction,
|
||||||
rule) < 0)
|
rule));
|
||||||
goto no_memory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return rule;
|
return rule;
|
||||||
|
|
||||||
no_memory:
|
|
||||||
firewall->err = ENOMEM;
|
|
||||||
virFirewallRuleFree(rule);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user