[gnome-settings-daemon] common: Fix crash when X isn't available



commit acfdada48a065d0815a9a8297b2a87997dc7eec2
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 19 10:37:00 2016 +0200

    common: Fix crash when X isn't available
    
    Oct 15 22:42:41 mydesktop.me gsd-media-keys[26358]: gsd-media-keys: Fatal IO error 11 (Resource 
temporarily unavailable) on X server :0.
    followed by:
     #0  0x000055ab3abdf860 in fprintf (__fmt=0x55ab3abfa28e "%s\n", __stream=<optimized out>) at 
/usr/include/bits/stdio2.h:97
     No locals.
     #1  main (argc=<optimized out>, argv=<optimized out>) at ../../plugins/common/daemon-skeleton-gtk.h:179
             error = 0x0
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1386511

 plugins/common/daemon-skeleton-gtk.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/common/daemon-skeleton-gtk.h b/plugins/common/daemon-skeleton-gtk.h
index 09b5251..e3d42cd 100644
--- a/plugins/common/daemon-skeleton-gtk.h
+++ b/plugins/common/daemon-skeleton-gtk.h
@@ -176,8 +176,10 @@ main (int argc, char **argv)
 
         error = NULL;
         if (! gtk_init_with_args (&argc, &argv, PLUGIN_NAME, entries, NULL, &error)) {
-                fprintf (stderr, "%s\n", error->message);
-                g_error_free (error);
+                if (error != NULL) {
+                        fprintf (stderr, "%s\n", error->message);
+                        g_error_free (error);
+                }
                 exit (1);
         }
 


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