summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-19 21:07:18 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-19 21:07:18 +0200
commitc72658ac79b62c3153f524011eab3f585b9e2b6f (patch)
treeea86d017a882c52a17fd63a0d37a2572bdff54e7 /audio
parent9cbb5351d644d7912238469320dca9d8c2c057d0 (diff)
Don't dereference the session if it was closed
Diffstat (limited to 'audio')
-rw-r--r--audio/avdtp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c
index ea055fbb..b3ae7bac 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -1660,7 +1660,7 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
gpointer data)
{
struct avdtp *session = data;
- struct avdtp_common_header *header = (void *) session->buf;
+ struct avdtp_common_header *header;
gsize size;
debug("session_cb");
@@ -1668,6 +1668,8 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
if (cond & G_IO_NVAL)
return FALSE;
+ header = (void *) session->buf;
+
if (cond & (G_IO_HUP | G_IO_ERR))
goto failed;