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:
parent
a3a7162b11
commit
7551cff986
@ -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))) {
|
||||
|
Loading…
Reference in New Issue
Block a user