From: Chris Lalancette Date: Fri, 23 Oct 2009 06:57:03 +0000 (+0200) Subject: Remove a completely bogus reference increment in the Xen driver. X-Git-Tag: v0.7.3~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6940109b9aa03fd6a12be164cddf55ed03c40e6d;p=thirdparty%2Flibvirt.git Remove a completely bogus reference increment in the Xen driver. 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 --- diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 5273a11530..f2744b095d 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -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; }