mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
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 <clalance@redhat.com>
This commit is contained in:
parent
43a9249c95
commit
6940109b9a
@ -1502,9 +1502,6 @@ xenUnifiedDomainEventRegister (virConnectPtr conn,
|
|||||||
ret = virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
|
ret = virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
|
||||||
callback, opaque, freefunc);
|
callback, opaque, freefunc);
|
||||||
|
|
||||||
if (ret == 0)
|
|
||||||
conn->refs++;
|
|
||||||
|
|
||||||
xenUnifiedUnlock(priv);
|
xenUnifiedUnlock(priv);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@ -1530,9 +1527,6 @@ xenUnifiedDomainEventDeregister (virConnectPtr conn,
|
|||||||
ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
|
ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
|
||||||
callback);
|
callback);
|
||||||
|
|
||||||
if (ret == 0)
|
|
||||||
virUnrefConnect(conn);
|
|
||||||
|
|
||||||
xenUnifiedUnlock(priv);
|
xenUnifiedUnlock(priv);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user