[Fix] Memory leak with CSList::ThrowAll() in NTFS_Common.h
This commit is contained in:
parent
c7985c9bc3
commit
23f3556145
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue