[NTOS]: Code formatting + free the memory in the reverse order from how it was allocated.

svn path=/trunk/; revision=74494
This commit is contained in:
Hermès Bélusca-Maïto 2017-05-08 00:51:44 +00:00
parent 837c766030
commit 32b595761c

View file

@ -878,7 +878,7 @@ IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode,
&ValueName,
0,
REG_DWORD,
(PVOID)&DeviceNode->CapabilityFlags,
&DeviceNode->CapabilityFlags,
sizeof(ULONG));
/* Set 'UINumber' value */
@ -1077,6 +1077,7 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
if (!NT_SUCCESS(Status))
{
DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status);
ExFreePool(FullServiceName.Buffer);
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
return Status;
}
@ -1086,8 +1087,8 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
if (!NT_SUCCESS(Status))
{
ZwClose(InstanceHandle);
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
ExFreePool(FullServiceName.Buffer);
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
return Status;
}
@ -1095,8 +1096,8 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
if (!Node->ServiceName.Buffer)
{
ZwClose(InstanceHandle);
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
ExFreePool(FullServiceName.Buffer);
ExFreePoolWithTag(Node, TAG_IO_DEVNODE);
return Status;
}
@ -1738,7 +1739,7 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode,
&ValueName,
0,
REG_SZ,
(PVOID)KeyValue.Buffer,
KeyValue.Buffer,
((ULONG)wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR));
cleanup: