[Fix] Memory leak with CSList::ThrowAll() in NTFS_Common.h

This commit is contained in:
Gamma 2017-10-26 09:47:53 +07:00
parent c7985c9bc3
commit 23f3556145
2 changed files with 18 additions and 0 deletions

View File

@ -220,6 +220,15 @@ public:
// Caution! All entries are just thrown without free
__inline void ThrowAll()
{
// Must free NTSLIST_ENTRY because InsertEntry() doesn't copy this pointer
while (ListHead)
{
ListCurrent = ListHead->Next;
ListHead->Entry = NULL;
delete ListHead;
ListHead = ListCurrent;
}
ListHead = ListTail = NULL;
ListCurrent = NULL;
EntryCount = 0;

View File

@ -220,6 +220,15 @@ public:
// Caution! All entries are just thrown without free
__inline void ThrowAll()
{
// Must free NTSLIST_ENTRY because InsertEntry() doesn't copy this pointer
while (ListHead)
{
ListCurrent = ListHead->Next;
ListHead->Entry = NULL;
delete ListHead;
ListHead = ListCurrent;
}
ListHead = ListTail = NULL;
ListCurrent = NULL;
EntryCount = 0;