mirror of https://gitee.com/openkylin/libvirt.git
networkStartNetworkVirtual: Don't leak macmap object
When starting network a macmap object is created (which stores MAC -> domain name mappings). However, if something goes wrong (e.g. virNetDevIPCheckIPv6Forwarding() fails) then the object is leaked. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
e101960761
commit
b88fce05ff
|
@ -2453,6 +2453,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
|
|||
goto err1;
|
||||
|
||||
virNetworkObjSetMacMap(obj, macmap);
|
||||
macmap = NULL;
|
||||
|
||||
/* Set bridge options */
|
||||
|
||||
|
@ -2590,6 +2591,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
|
|||
ignore_value(virNetDevTapDelete(macTapIfName, NULL));
|
||||
VIR_FREE(macTapIfName);
|
||||
}
|
||||
virNetworkObjUnrefMacMap(obj);
|
||||
VIR_FREE(macMapFile);
|
||||
|
||||
err0:
|
||||
|
|
Loading…
Reference in New Issue