[mutter] output-xrand: Plug a memory leak



commit db0f12135ebc0d1ff11556140f36851228ce41bc
Author: Alessandro Bono <alessandro bono369 gmail com>
Date:   Fri Sep 2 10:21:04 2022 +0200

    output-xrand: Plug a memory leak
    
    Fixes: 99d84ae1cc8f027a35c32d266cef48758daaff6d
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2608>

 src/backends/x11/meta-output-xrandr.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/x11/meta-output-xrandr.c b/src/backends/x11/meta-output-xrandr.c
index 11f693a04d..bb6588de37 100644
--- a/src/backends/x11/meta-output-xrandr.c
+++ b/src/backends/x11/meta-output-xrandr.c
@@ -461,9 +461,15 @@ output_get_max_bpc_range_xrandr (Display      *xdisplay,
                                           atom);
   meta_clutter_x11_untrap_x_errors ();
 
-  if (!property_info || property_info->num_values != 2)
+  if (!property_info)
     return FALSE;
 
+  if (property_info->num_values != 2)
+    {
+      XFree (property_info);
+      return FALSE;
+    }
+
   values = (long *) property_info->values;
   if (min)
     *min = values[0];


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