From: John Ferlan Date: Wed, 26 Jul 2017 11:42:51 +0000 (-0400) Subject: network: Unconditionally initialize macmap when stopping virtual network X-Git-Tag: v3.7.0-rc1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f5e32d30524bf9e2012df53bfb5eaa4b58c7061;p=thirdparty%2Flibvirt.git 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 --- 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; }