Add missing NULL pointer check to DCB list handling

The thread specific list removal function didn't check whether the last
item was NULL before proceeding to alter the latest tail pointer.
This commit is contained in:
Markus Makela 2016-11-24 09:36:37 +02:00
parent b32af705e6
commit b09bf56127

View File

@ -3446,7 +3446,11 @@ static void dcb_remove_from_list(DCB *dcb)
{
DCB *tail = all_dcbs[dcb->thread.id]->thread.tail;
all_dcbs[dcb->thread.id] = all_dcbs[dcb->thread.id]->thread.next;
all_dcbs[dcb->thread.id]->thread.tail = tail;
if (all_dcbs[dcb->thread.id])
{
all_dcbs[dcb->thread.id]->thread.tail = tail;
}
}
else
{