summaryrefslogtreecommitdiff
path: root/src/console-kit.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2011-09-07 14:43:25 +1000
committerRobert Ancell <robert.ancell@canonical.com>2011-09-07 14:43:25 +1000
commit6f513aa004948ba3663f7b85e71c81e587f73c1c (patch)
treee83798cb8634dd70f35f25c3fe6dfdc6aa05e3f1 /src/console-kit.c
parent9fee1b6bedceefa7f108cb3a131356722f6f8329 (diff)
downloadlightdm-6f513aa004948ba3663f7b85e71c81e587f73c1c.tar.gz
make consolekit code more paranoid
Diffstat (limited to 'src/console-kit.c')
-rw-r--r--src/console-kit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/console-kit.c b/src/console-kit.c
index e02fb0ad..7cdba757 100644
--- a/src/console-kit.c
+++ b/src/console-kit.c
@@ -44,6 +44,8 @@ ck_start_session (GVariantBuilder *parameters)
gchar *cookie = NULL;
GError *error = NULL;
+ g_return_val_if_fail (parameters != NULL, NULL);
+
/* Only start ConsoleKit sessions when running as root */
if (getuid () != 0)
return NULL;
@@ -85,8 +87,7 @@ ck_unlock_session (const gchar *cookie)
gchar *session_path = NULL;
GError *error = NULL;
- if (!cookie)
- return;
+ g_return_if_fail (cookie != NULL);
if (!load_ck_proxy ())
return;
@@ -242,8 +243,7 @@ ck_end_session (const gchar *cookie)
GVariant *result;
GError *error = NULL;
- if (!cookie)
- return;
+ g_return_if_fail (cookie != NULL);
if (!load_ck_proxy ())
return;