TCP: check for sndcb before using it

This commit is contained in:
Andrew Webster 2016-01-22 15:54:45 -06:00 committed by Gregory Nutt
parent df211ee46a
commit cdd187a7f3

View File

@ -181,8 +181,11 @@ static inline void psock_lost_connection(FAR struct socket *psock,
/* Do not allow any further callbacks */
psock->s_sndcb->flags = 0;
psock->s_sndcb->event = NULL;
if (psock->s_sndcb != NULL)
{
psock->s_sndcb->flags = 0;
psock->s_sndcb->event = NULL;
}
/* Free all queued write buffers */