From 5a8c0d9fc18a40bfca2991136805e08f0f10b5e8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 19 Jul 2014 17:50:56 +0000 Subject: [PATCH] [NTOS:FSTUB] - Make sure to NULL the return pointer in the failure case of xHalIoReadPartitionTable. CORE-8359 svn path=/trunk/; revision=63722 --- reactos/ntoskrnl/fstub/disksup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;