]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Make sure we won't try to call free functions on null pointers.
authorLaércio de Sousa <lbsousajr@gmail.com>
Thu, 28 Aug 2014 14:38:54 +0000 (11:38 -0300)
committerLaércio de Sousa <lbsousajr@gmail.com>
Thu, 28 Aug 2014 14:38:54 +0000 (11:38 -0300)
src/lightdm.c

index 510bcd8c0aecd1bd0bb12ae5811290401369c9ad..2b2b14582d839b8a604f29b56a6cd9129a705ae7 100644 (file)
@@ -161,7 +161,8 @@ get_config_sections (const gchar *seat_name)
                 config_sections = g_list_append (config_sections, g_strdup (*i));
         }
     }
-    g_strfreev (groups);
+    if (groups)
+        g_strfreev (groups);
     return config_sections;
 }
 
@@ -246,7 +247,8 @@ display_manager_seat_removed_cb (DisplayManager *display_manager, Seat *seat)
         config_sections = get_config_sections (seat_get_name (seat));
         for (link = config_sections; link; link = link->next)
             set_seat_properties (next_seat, (gchar*) link->data);
-        g_list_free_full (config_sections, g_free);
+        if (config_sections)
+            g_list_free_full (config_sections, g_free);
 
         // We set this manually on default seat.  Let's port it over if needed.
         if (seat_get_boolean_property (seat, "exit-on-failure"))
@@ -1007,7 +1009,8 @@ add_login1_seat (Login1Seat *login1_seat)
             g_debug ("Failed to start seat: %s", seat_name);
     }
 
-    g_list_free_full (config_sections, g_free);
+    if (config_sections)
+        g_list_free_full (config_sections, g_free);
     g_object_unref (seat);
   
     return started;