[mutter] kms: Fix drmModeEncoder leak
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms: Fix drmModeEncoder leak
- Date: Fri, 24 Jan 2020 21:16:56 +0000 (UTC)
commit abc58f7b9d591f4b9f62b3536938a9ab57137a76
Author: Sebastian Keller <skeller gnome org>
Date: Fri Jan 24 18:51:03 2020 +0100
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]