summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-03-19 11:36:10 +1300
committerRobert Ancell <robert.ancell@canonical.com>2015-03-19 11:36:10 +1300
commit08c04b130372666bef16f380410bafb01f20f26b (patch)
tree3c4bef94a001760cb763ae6a9deda523231ad5d5 /tests
parentb86dee154985649346510ffaa801a47d9669e6ce (diff)
downloadlightdm-08c04b130372666bef16f380410bafb01f20f26b.tar.gz
Fix small errors detected by scan-build (clang)
Diffstat (limited to 'tests')
-rw-r--r--tests/src/libsystem.c2
-rw-r--r--tests/src/test-runner.c15
-rw-r--r--tests/src/unity-system-compositor.c3
3 files changed, 12 insertions, 8 deletions
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index a5cbb37f..97791d16 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -1222,6 +1222,8 @@ pam_authenticate (pam_handle_t *pamh, int flags)
result = pamh->conversation.conv (1, (const struct pam_message **) msg, &resp, pamh->conversation.appdata_ptr);
free (msg[0]);
free (msg);
+ if (result != PAM_SUCCESS)
+ return result;
if (resp == NULL)
return PAM_CONV_ERR;
diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c
index 721efec9..fad4b746 100644
--- a/tests/src/test-runner.c
+++ b/tests/src/test-runner.c
@@ -907,17 +907,18 @@ handle_command (const gchar *command)
user->xsession = g_strdup (g_hash_table_lookup (params, "SESSION"));
g_string_append_printf (status_text, " SESSION=%s", user->xsession);
}
+
+ g_dbus_connection_emit_signal (accounts_connection,
+ NULL,
+ user->path,
+ "org.freedesktop.Accounts.User",
+ "Changed",
+ g_variant_new ("()"),
+ &error);
}
else
g_warning ("Unknown user %s", username);
- g_dbus_connection_emit_signal (accounts_connection,
- NULL,
- user->path,
- "org.freedesktop.Accounts.User",
- "Changed",
- g_variant_new ("()"),
- &error);
if (error)
g_warning ("Failed to emit Changed: %s", error->message);
g_clear_error (&error);
diff --git a/tests/src/unity-system-compositor.c b/tests/src/unity-system-compositor.c
index f14cdf9c..15f68622 100644
--- a/tests/src/unity-system-compositor.c
+++ b/tests/src/unity-system-compositor.c
@@ -57,7 +57,8 @@ write_message (guint16 id, const guint8 *payload, guint16 payload_length)
data[1] = id & 0xFF;
data[2] = payload_length >> 8;
data[3] = payload_length & 0xFF;
- memcpy (data + 4, payload, payload_length);
+ if (payload)
+ memcpy (data + 4, payload, payload_length);
if (write (to_dm_fd, data, data_length) < 0)
fprintf (stderr, "Failed to write to daemon: %s\n", strerror (errno));