1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 00:03:45 +00:00

Fixed potential infinite loop

This commit is contained in:
Bryan Roe
2021-01-26 17:42:34 -08:00
parent 96b50f2dea
commit 85ff9aece8

View File

@@ -8246,7 +8246,10 @@ void ILibLinkedList_Destroy(void *LinkedList)
if (ILibMemory_CanaryOK(LinkedList))
{
struct ILibLinkedListNode_Root *r = (struct ILibLinkedListNode_Root*)LinkedList;
while (r->Head != NULL) ILibLinkedList_Remove(ILibLinkedList_GetNode_Head(LinkedList));
while (r->Head != NULL && ILibLinkedList_GetNode_Head(LinkedList) != NULL)
{
ILibLinkedList_Remove(ILibLinkedList_GetNode_Head(LinkedList));
}
ILibMemory_Free(r);
}
}