[NTOS:IO] Do not ignore RtlDuplicateUnicodeString return value

CORE-17637
This commit is contained in:
Jérôme Gardou
2021-06-28 10:20:57 +02:00
committed by Jérôme Gardou
parent cf1a95a588
commit 838abc475c
+8 -4
View File
@@ -1396,6 +1396,14 @@ IopSetServiceEnumData(
goto done;
}
Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING,
&ServiceName,
&DeviceNode->ServiceName);
if (!NT_SUCCESS(Status))
{
goto done;
}
RtlInitUnicodeString(&EnumKeyName, L"Enum");
Status = IopCreateRegistryKeyEx(&ServiceEnumKey,
ServiceKey,
@@ -1480,10 +1488,6 @@ IopSetServiceEnumData(
sizeof(NextInstance));
}
RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING,
&ServiceName,
&DeviceNode->ServiceName);
done:
if (ServiceEnumKey != NULL)
ZwClose(ServiceEnumKey);