On Mon, Aug 13, 2018 at 11:21:45AM +0200, Michal Privoznik wrote:
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(a)redhat.com>
---
src/network/bridge_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index f92cc61e47..588b0d147d 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -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);
Hopefully there's no occurrence of plain virObjectUnref for obj->macmap.
Reviewed-by: Erik Skultety <eskultet(a)redhat.com>