Don't dereference the session if it was closed

This commit is contained in:
Johan Hedberg 2009-02-19 21:07:18 +02:00
parent 9cbb5351d6
commit c72658ac79

View File

@ -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;