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 <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2017-07-26 07:42:51 -04:00
parent f4adeae09d
commit 4f5e32d305

View File

@ -125,8 +125,8 @@ virNetworkObjSetMacMap(virNetworkObjPtr obj,
void
virNetworkObjUnrefMacMap(virNetworkObjPtr obj)
{
if (!virObjectUnref(obj->macmap))
obj->macmap = NULL;
virObjectUnref(obj->macmap);
obj->macmap = NULL;
}