}\r
// Check if we have found a node that could contain our new allocation\r
if (NewNode != NULL) {\r
- NewNode->Allocated = TRUE;\r
- Node->Allocation = (VOID*)(UINTN)Node->Base;\r
- *Allocation = Node->Allocation;\r
+ NewNode->Allocated = TRUE;\r
+ NewNode->Allocation = (VOID*)(UINTN)NewNode->Base;\r
+ *Allocation = NewNode->Allocation;\r
+ mFreedBufferSize -= NewNode->Pages * EFI_PAGE_SIZE;\r
return EFI_SUCCESS;\r
}\r
\r