]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove a completely bogus reference increment in the Xen driver.
authorChris Lalancette <clalance@redhat.com>
Fri, 23 Oct 2009 06:57:03 +0000 (08:57 +0200)
committerChris Lalancette <clalance@redhat.com>
Mon, 26 Oct 2009 09:31:42 +0000 (10:31 +0100)
xenUnifiedDomainEventRegister() calls out to
virDomainEventCallbackListAdd(), which increments the reference
count on the connection.  That is fine, but then
xenUnifiedDomainEventRegister() increments the usage count again,
leading to a usage count leak.  Remove the increment in the xen
register, and the UnrefConnect in the xen unregister.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/xen/xen_driver.c

index 5273a115309234688aac51f7bb500c4ffd75989f..f2744b095d61ba60b2ecf3db18689b82168d0920 100644 (file)
@@ -1502,9 +1502,6 @@ xenUnifiedDomainEventRegister (virConnectPtr conn,
     ret = virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
                                         callback, opaque, freefunc);
 
-    if (ret == 0)
-        conn->refs++;
-
     xenUnifiedUnlock(priv);
     return (ret);
 }
@@ -1530,9 +1527,6 @@ xenUnifiedDomainEventDeregister (virConnectPtr conn,
         ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
                                                callback);
 
-    if (ret == 0)
-        virUnrefConnect(conn);
-
     xenUnifiedUnlock(priv);
     return ret;
 }