Clear the internal list links to prevent corruption
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 34s
Builds / ExectOS (i686, debug) (push) Successful in 33s
Builds / ExectOS (i686, release) (push) Successful in 41s
Builds / ExectOS (amd64, debug) (push) Successful in 45s

This commit is contained in:
2026-03-25 07:48:13 +01:00
parent 970902f3f9
commit 1e01c52c0c

View File

@@ -357,6 +357,10 @@ MM::Allocator::AllocatePool(IN MMPOOL_TYPE PoolType,
/* Register the allocation in the tracking table */ /* Register the allocation in the tracking table */
RegisterAllocationTag(Tag, SIZE_TO_PAGES(Bytes), PoolType); RegisterAllocationTag(Tag, SIZE_TO_PAGES(Bytes), PoolType);
/* Clear the internal list links to prevent corruption */
((PLIST_ENTRY)PoolEntry)->Flink = NULLPTR;
((PLIST_ENTRY)PoolEntry)->Blink = NULLPTR;
/* Supply the allocated address and return success */ /* Supply the allocated address and return success */
*Memory = PoolEntry; *Memory = PoolEntry;
return STATUS_SUCCESS; return STATUS_SUCCESS;
@@ -464,7 +468,7 @@ MM::Allocator::AllocatePool(IN MMPOOL_TYPE PoolType,
/* Assign the specified identification tag */ /* Assign the specified identification tag */
PoolEntry->PoolTag = Tag; PoolEntry->PoolTag = Tag;
/* Clear the internal list links */ /* Clear the internal list links to prevent corruption */
(GetPoolFreeBlock(PoolEntry))->Flink = NULLPTR; (GetPoolFreeBlock(PoolEntry))->Flink = NULLPTR;
(GetPoolFreeBlock(PoolEntry))->Blink = NULLPTR; (GetPoolFreeBlock(PoolEntry))->Blink = NULLPTR;
@@ -538,6 +542,10 @@ MM::Allocator::AllocatePool(IN MMPOOL_TYPE PoolType,
/* Apply the requested identification tag */ /* Apply the requested identification tag */
PoolEntry->PoolTag = Tag; PoolEntry->PoolTag = Tag;
/* Clear the internal list links to prevent corruption */
(GetPoolFreeBlock(PoolEntry))->Flink = NULLPTR;
(GetPoolFreeBlock(PoolEntry))->Blink = NULLPTR;
/* Supply the allocated address and return success */ /* Supply the allocated address and return success */
*Memory = GetPoolFreeBlock(PoolEntry); *Memory = GetPoolFreeBlock(PoolEntry);
return STATUS_SUCCESS; return STATUS_SUCCESS;