summaryrefslogtreecommitdiffstats
path: root/audio/unix.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-13 19:59:52 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-13 19:59:52 +0000
commitf1a26f036b1fd1aa8f31dfbe2d857b0bb31abaa1 (patch)
tree1153e258028966770eca81866d5220b73cf38982 /audio/unix.c
parentbc37b7850f1bd8018d3b42d6530bf6792b715613 (diff)
Handle unix client disconnect properly before we have received a configuration message
Diffstat (limited to 'audio/unix.c')
-rw-r--r--audio/unix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/unix.c b/audio/unix.c
index d977633c..52b27809 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -162,7 +162,8 @@ static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
if (cond & (G_IO_HUP | G_IO_ERR)) {
debug("Unix client disconnected");
- device_set_state(client->dev, STATE_CONNECTED);
+ if (client->dev)
+ device_set_state(client->dev, STATE_CONNECTED);
goto failed;
}
@@ -232,7 +233,7 @@ static gboolean server_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
debug("Accepted new client connection on unix socket");
- client = g_new(struct unix_client, 1);
+ client = g_new0(struct unix_client, 1);
client->sock = cli_sk;
clients = g_slist_append(clients, client);