From 4f5e32d30524bf9e2012df53bfb5eaa4b58c7061 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Wed, 26 Jul 2017 07:42:51 -0400 Subject: [PATCH] network: Unconditionally initialize macmap when stopping virtual network Since we can only ever have one reference to obj->macmap, rather than only clearing obj->macmap during virNetworkObjUnrefMacMap (e.g. virtual network from networkShutdownNetwork), let's just unconditionally clear the obj->macmap to ensure that some future change that created it's own reference to obj->macmap wouldn't have that reference disappear if virNetworkObjDispose got called. Signed-off-by: John Ferlan --- src/conf/virnetworkobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index b58af23753..89662577bc 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -125,8 +125,8 @@ virNetworkObjSetMacMap(virNetworkObjPtr obj, void virNetworkObjUnrefMacMap(virNetworkObjPtr obj) { - if (!virObjectUnref(obj->macmap)) - obj->macmap = NULL; + virObjectUnref(obj->macmap); + obj->macmap = NULL; } -- GitLab