compositor-drm: Fix memory leak in update_outputs

We need to correctly free every connector we retrieve. We currently loose them
if they are not connected.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2011-12-08 17:05:43 +01:00 committed by Kristian Høgsberg
parent a3a7162b11
commit 7551cff986

View File

@ -609,10 +609,14 @@ update_outputs(struct drm_compositor *ec)
int connector_id = resources->connectors[i];
connector = drmModeGetConnector(ec->drm.fd, connector_id);
if (connector == NULL ||
connector->connection != DRM_MODE_CONNECTED)
if (connector == NULL)
continue;
if (connector->connection != DRM_MODE_CONNECTED) {
drmModeFreeConnector(connector);
continue;
}
connected |= (1 << connector_id);
if (!(ec->connector_allocator & (1 << connector_id))) {