From df9115f1d23ff7cccae0a9fe356a0ce9e0bbc09c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 22 May 2010 16:03:25 +0000 Subject: [PATCH] [NTOSKRNL] - Free the string buffer after the DPRINT1 that prints the contents of the string - Fixes debug print corruption found by kmtest svn path=/trunk/; revision=47307 --- reactos/ntoskrnl/io/iomgr/driver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index 1ab54458526..d32957ec7d7 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -1171,17 +1171,18 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers) 0, (PVOID*)&DriverObject); - /* - * Free the buffer for driver object name - */ - ExFreePool(ObjectName.Buffer); - if (!NT_SUCCESS(Status)) { DPRINT1("Can't locate driver object for %wZ\n", &ObjectName); + ExFreePool(ObjectName.Buffer); return Status; } + /* + * Free the buffer for driver object name + */ + ExFreePool(ObjectName.Buffer); + /* Check that driver is not already unloading */ if (DriverObject->Flags & DRVO_UNLOAD_INVOKED) { -- 2.17.1