[ros-diffs] [cgutman] 47307: [NTOSKRNL] - Free the string buffer after the DPRINT1 that prints the contents of the string - Fixes debug print corruption found by kmtest

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sat May 22 18:03:25 CEST 2010


Author: cgutman
Date: Sat May 22 18:03:25 2010
New Revision: 47307

URL: http://svn.reactos.org/svn/reactos?rev=47307&view=rev
Log:
[NTOSKRNL]
- Free the string buffer after the DPRINT1 that prints the contents of the string
- Fixes debug print corruption found by kmtest

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/driver.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c?rev=47307&r1=47306&r2=47307&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Sat May 22 18:03:25 2010
@@ -1171,16 +1171,17 @@
                                     0,
                                     (PVOID*)&DriverObject);
 
+   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);
-
-   if (!NT_SUCCESS(Status))
-   {
-      DPRINT1("Can't locate driver object for %wZ\n", &ObjectName);
-      return Status;
-   }
 
    /* Check that driver is not already unloading */
    if (DriverObject->Flags & DRVO_UNLOAD_INVOKED)




More information about the Ros-diffs mailing list