diff --git a/reactos/ntoskrnl/fstub/disksup.c b/reactos/ntoskrnl/fstub/disksup.c index 86a7e0ad6b0..f5aeb4192f1 100644 --- a/reactos/ntoskrnl/fstub/disksup.c +++ b/reactos/ntoskrnl/fstub/disksup.c @@ -1787,7 +1787,11 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, /* Free the buffer and check for success */ if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); - if (!NT_SUCCESS(Status)) ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); + *PartitionBuffer = NULL; + } /* Return status */ return Status;