fixed bug in thread_array_management

This commit is contained in:
2020-11-16 18:15:24 +03:00
parent 14fd51d5fa
commit 257b3f0ebe
2 changed files with 168 additions and 2 deletions

View File

@@ -78,8 +78,9 @@ static char *popmessage(msglist **lst){
if(!lst || !*lst) return NULL;
char *ret;
msglist *node = *lst;
ret = (*lst)->data;
*lst = (*lst)->next;
if(node->next) node->next->last = node->last; // pop not last message
ret = node->data;
*lst = node->next;
FREE(node);
return ret;
}