]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: Unconditionally initialize macmap when stopping virtual network
authorJohn Ferlan <jferlan@redhat.com>
Wed, 26 Jul 2017 11:42:51 +0000 (07:42 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 16 Aug 2017 18:17:57 +0000 (14:17 -0400)
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>
src/conf/virnetworkobj.c

index b58af237530a8c554debc8ffd4762d7da5c2ad0c..89662577bc123a490d1a63751035b8a75221dfb2 100644 (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;
 }