[metacity/gnome-3-34] xrender: fix memory leak



commit e1d52ce1832a17ea004c3cb82cb57d237db4b419
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Sep 13 16:23:28 2019 +0300

    xrender: fix memory leak

 src/compositor/meta-compositor-xrender.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 50f78c02..00f8f8b2 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -2355,7 +2355,13 @@ meta_compositor_xrender_finalize (GObject *object)
       int i;
 
       for (i = 0; i < LAST_SHADOW_TYPE; i++)
-        g_free (xrender->shadows[i]->gaussian_map);
+        {
+          g_clear_pointer (&xrender->shadows[i]->gaussian_map, g_free);
+          g_clear_pointer (&xrender->shadows[i]->shadow_corner, g_free);
+          g_clear_pointer (&xrender->shadows[i]->shadow_top, g_free);
+
+          g_clear_pointer (&xrender->shadows[i], g_free);
+        }
     }
 
   G_OBJECT_CLASS (meta_compositor_xrender_parent_class)->finalize (object);


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