[mutter] kms/crtc: Fix gamma state leak



commit 9feda1c58bfaa7573fa955351ecc537709b80055
Author: Sebastian Keller <skeller gnome org>
Date:   Fri Jan 24 18:46:20 2020 +0100

    kms/crtc: Fix gamma state leak
    
    The gamma value pointers of the current_state are overwritten by the
    calls to memdup causing a small leak. while the leak itself is small, it
    can be triggered quite often from things like night light.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1020

 src/backends/native/meta-kms-crtc.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c
index da99a58cd..6cf752494 100644
--- a/src/backends/native/meta-kms-crtc.c
+++ b/src/backends/native/meta-kms-crtc.c
@@ -203,6 +203,7 @@ meta_kms_crtc_predict_state (MetaKmsCrtc   *crtc,
       if (gamma->crtc != crtc)
         continue;
 
+      clear_gamma_state (crtc);
       crtc->current_state.gamma.size = gamma->size;
       crtc->current_state.gamma.red =
         g_memdup (gamma->red, gamma->size * sizeof (uint16_t));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]