]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
remote: Set *neventCallbacks to zero at DEREG_CB
authorxinhua.Cao <caoxinhua@huawei.com>
Sat, 11 Nov 2017 08:30:41 +0000 (16:30 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Sun, 12 Nov 2017 14:35:37 +0000 (09:35 -0500)
To avoid the chance that the loop is run twice, set the neventCallbacks
to zero after VIR_FREE(eventCallbacks) was called.

daemon/remote.c

index 07557e9c3558321ce762f45907eb87d1989173d9..cbcb6e8419c55c73ed931cd556b8e857db89da34 100644 (file)
@@ -1686,6 +1686,7 @@ void remoteRelayConnectionClosedEvent(virConnectPtr conn ATTRIBUTE_UNUSED, int r
                 VIR_WARN("unexpected %s event deregister failure", name); \
         } \
         VIR_FREE(eventCallbacks); \
+        neventCallbacks = 0; \
     } while (0);
 
 /*