diff --git a/reactos/ntoskrnl/fstub/fstubex.c b/reactos/ntoskrnl/fstub/fstubex.c index 6564df9f949..e6f97e2aef7 100644 --- a/reactos/ntoskrnl/fstub/fstubex.c +++ b/reactos/ntoskrnl/fstub/fstubex.c @@ -1605,7 +1605,7 @@ FstubWritePartitionTableMBR(IN PDISK_INFORMATION Disk, DriveLayout); /* Free allocated structure and return */ - ExFreePool(DriveLayout); + ExFreePoolWithTag(DriveLayout, 'BtsF'); return Status; } diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index d2d28b83b2a..45c2d1697a3 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -1770,7 +1770,7 @@ IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, if (!Inserted) { /* Free the entry and fail */ - ExFreePool(NewDriverExtension); + ExFreePoolWithTag(NewDriverExtension, TAG_DRIVER_EXTENSION); return STATUS_OBJECT_NAME_COLLISION; } diff --git a/reactos/ntoskrnl/io/iomgr/error.c b/reactos/ntoskrnl/io/iomgr/error.c index 0fa5f56d648..07197ff39b4 100644 --- a/reactos/ntoskrnl/io/iomgr/error.c +++ b/reactos/ntoskrnl/io/iomgr/error.c @@ -486,8 +486,8 @@ IoAllocateErrorLogEntry(IN PVOID IoObject, { PERROR_LOG_ENTRY LogEntry; ULONG LogEntrySize; - PDRIVER_OBJECT DriverObject; PDEVICE_OBJECT DeviceObject; + PDRIVER_OBJECT DriverObject; /* Make sure we have an object */ if (!IoObject) return NULL; @@ -495,13 +495,6 @@ IoAllocateErrorLogEntry(IN PVOID IoObject, /* Check if we're past our buffer */ if (IopTotalLogSize > PAGE_SIZE) return NULL; - /* Calculate the total size and allocate it */ - LogEntrySize = sizeof(ERROR_LOG_ENTRY) + EntrySize; - LogEntry = ExAllocatePoolWithTag(NonPagedPool, - LogEntrySize, - TAG_ERROR_LOG); - if (!LogEntry) return NULL; - /* Check if this is a device object or driver object */ if (((PDEVICE_OBJECT)IoObject)->Type == IO_TYPE_DEVICE) { @@ -511,9 +504,9 @@ IoAllocateErrorLogEntry(IN PVOID IoObject, } else if (((PDEVICE_OBJECT)IoObject)->Type == IO_TYPE_DRIVER) { - /* It's a driver, so we don' thave a device */ + /* It's a driver, so we don't have a device */ DeviceObject = NULL; - DriverObject = IoObject; + DriverObject = (PDRIVER_OBJECT)IoObject; } else { @@ -521,6 +514,13 @@ IoAllocateErrorLogEntry(IN PVOID IoObject, return NULL; } + /* Calculate the total size and allocate it */ + LogEntrySize = sizeof(ERROR_LOG_ENTRY) + EntrySize; + LogEntry = ExAllocatePoolWithTag(NonPagedPool, + LogEntrySize, + TAG_ERROR_LOG); + if (!LogEntry) return NULL; + /* Reference the Objects */ if (DeviceObject) ObReferenceObject(DeviceObject); if (DriverObject) ObReferenceObject(DriverObject);