[gdm] Don't try to delete a NULL user
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Don't try to delete a NULL user
- Date: Sat, 29 Sep 2012 03:20:14 +0000 (UTC)
commit 6eeb747f1b056e6c10ad4390001ae094575d9c94
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 28 23:19:27 2012 -0400
Don't try to delete a NULL user
It doesn't work. In particular, unreffing NULL is bad news.
daemon/gdm-simple-slave.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index b7053ac..0b1bcd0 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -1197,12 +1197,13 @@ destroy_initial_setup_user (GdmSimpleSlave *slave)
error = NULL;
user = act_user_manager_get_user (act, INITIAL_SETUP_USERNAME);
- if (!act_user_manager_delete_user (act, user, TRUE, &error)) {
- g_warning ("Failed to delete user '%s': %s", INITIAL_SETUP_USERNAME, error->message);
- g_error_free (error);
+ if (user != NULL) {
+ if (!act_user_manager_delete_user (act, user, TRUE, &error)) {
+ g_warning ("Failed to delete user '%s': %s", INITIAL_SETUP_USERNAME, error->message);
+ g_error_free (error);
+ }
+ g_object_unref (user);
}
-
- g_object_unref (user);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]