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>
ret = virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
callback, opaque, freefunc);
- if (ret == 0)
- conn->refs++;
-
xenUnifiedUnlock(priv);
return (ret);
}
ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
callback);
- if (ret == 0)
- virUnrefConnect(conn);
-
xenUnifiedUnlock(priv);
return ret;
}