mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 18:05:20 +00:00
nwfilter: Remove redundant check if object exists
The same check is done by virNWFilterBindingObjListAdd(). The main issue with the current code is that if the object already exists we would leak 'def' because 'obj' would be set and the cleanup code frees 'def' only if 'obj' is NULL. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
8ac95faf45
commit
3379193f1c
@ -752,13 +752,6 @@ nwfilterBindingCreateXML(virConnectPtr conn,
|
||||
if (virNWFilterBindingCreateXMLEnsureACL(conn, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
obj = virNWFilterBindingObjListFindByPortDev(driver->bindings, def->portdevname);
|
||||
if (obj) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Filter already present for NIC %s"), def->portdevname);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
obj = virNWFilterBindingObjListAdd(driver->bindings,
|
||||
def);
|
||||
if (!obj)
|
||||
|
Loading…
x
Reference in New Issue
Block a user