[gnome-flashback] desktop: initialize prop variable



commit 95f5de992d69f7593bfdeb670f704b75430a2f4d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Jan 22 16:26:08 2020 +0200

    desktop: initialize prop variable

 gnome-flashback/libdesktop/gf-desktop-window.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gnome-flashback/libdesktop/gf-desktop-window.c b/gnome-flashback/libdesktop/gf-desktop-window.c
index 55fa234..5fa4bb2 100644
--- a/gnome-flashback/libdesktop/gf-desktop-window.c
+++ b/gnome-flashback/libdesktop/gf-desktop-window.c
@@ -100,6 +100,7 @@ get_representative_color (GfDesktopWindow *self,
 
   gdk_x11_display_error_trap_push (display);
 
+  prop = NULL;
   status = XGetWindowProperty (xdisplay,
                                XDefaultRootWindow (xdisplay),
                                atom,
@@ -115,10 +116,9 @@ get_representative_color (GfDesktopWindow *self,
 
   gdk_x11_display_error_trap_pop_ignored (display);
 
-  if (status != Success)
-    return FALSE;
-
-  if (n_items == 0)
+  if (status != Success ||
+      actual_type != XA_STRING ||
+      n_items == 0)
     {
       XFree (prop);
       return FALSE;


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