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>
dev
David Herrmann 13 years ago committed by Kristian Høgsberg
parent a3a7162b11
commit 7551cff986
  1. 8
      compositor/compositor-drm.c

@ -609,9 +609,13 @@ 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);

Loading…
Cancel
Save