[gnome-flashback] output-xrandr: fix memory leak



commit b82a22ae8cf9dcc4cf21e1bec7f7cc4e2217b256
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Aug 21 17:24:45 2022 +0300

    output-xrandr: fix memory leak

 backends/gf-output-xrandr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/backends/gf-output-xrandr.c b/backends/gf-output-xrandr.c
index 55d25fb..2bcf494 100644
--- a/backends/gf-output-xrandr.c
+++ b/backends/gf-output-xrandr.c
@@ -750,12 +750,14 @@ output_get_supports_underscanning_xrandr (Display  *xdisplay,
   Atom atom, actual_type;
   gint actual_format, i;
   gulong nitems, bytes_after;
-  guchar *buffer;
+  unsigned char *buffer;
   XRRPropertyInfo *property_info;
   Atom *values;
   gboolean supports_underscanning = FALSE;
 
   atom = XInternAtom (xdisplay, "underscan", False);
+  buffer = NULL;
+
   XRRGetOutputProperty (xdisplay, (XID) output_id, atom,
                         0, G_MAXLONG, False, False, XA_ATOM,
                         &actual_type, &actual_format,
@@ -769,6 +771,8 @@ output_get_supports_underscanning_xrandr (Display  *xdisplay,
       return FALSE;
     }
 
+  XFree (buffer);
+
   property_info = XRRQueryOutputProperty (xdisplay, (XID) output_id, atom);
   values = (Atom *) property_info->values;
 


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