- Don't touch the freed buffer in case of an error
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 21 Aug 2009 10:30:05 +0000 (10:30 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 21 Aug 2009 10:30:05 +0000 (10:30 +0000)
- Found by Amine Khaldi

svn path=/trunk/; revision=42821

reactos/ntoskrnl/io/iomgr/deviface.c

index d83124a..51b2b7a 100644 (file)
@@ -920,7 +920,10 @@ IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject,
         DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
         ExFreePool(SymbolicLinkName->Buffer);
     }
-    SymbolicLinkName->Buffer[1] = '?';
+    else
+    {
+        SymbolicLinkName->Buffer[1] = '?';
+    }
 
     ZwClose(SubKey);
     ZwClose(InterfaceKey);