From abc58f7b9d591f4b9f62b3536938a9ab57137a76 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Fri, 24 Jan 2020 18:51:03 +0100 Subject: [PATCH] kms: Fix drmModeEncoder leak The result of drmModeGetEncoder() needs to be free'd by the caller. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1020 --- src/backends/native/meta-kms-connector.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c index c018a5e62..ce8d28ae0 100644 --- a/src/backends/native/meta-kms-connector.c +++ b/src/backends/native/meta-kms-connector.c @@ -381,8 +381,11 @@ set_encoder_device_idx_bit (uint32_t *encoder_device_idxs, if (drm_encoder->encoder_id == encoder_id) { *encoder_device_idxs |= (1 << i); + drmModeFreeEncoder (drm_encoder); break; } + + drmModeFreeEncoder (drm_encoder); } } @@ -421,6 +424,8 @@ state_set_crtc_state (MetaKmsConnectorState *state, if (drm_connector->encoder_id == drm_encoder->encoder_id) state->current_crtc_id = drm_encoder->crtc_id; + + drmModeFreeEncoder (drm_encoder); } state->common_possible_crtcs = common_possible_crtcs;