[SDK:RTL] Consistently use the Allocate/FreeStringMemory helpers when allocating/freeing string buffers.

This commit is contained in:
Hermès Bélusca-Maïto 2022-03-21 21:04:44 +01:00
parent ab827f5225
commit e51c305f51
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 3 additions and 3 deletions

View file

@ -2532,11 +2532,11 @@ Quickie:
DPRINT("Status: %lx %S %S\n", Status, StaticBuffer, TempDynamicString.Buffer);
if ((StaticString) && (StaticBuffer) && (StaticBuffer != StaticString->Buffer))
{
RtlpFreeMemory(StaticBuffer, TAG_USTR);
RtlpFreeStringMemory(StaticBuffer, TAG_USTR);
}
if (TempDynamicString.Buffer)
{
RtlpFreeMemory(TempDynamicString.Buffer, TAG_USTR);
RtlpFreeStringMemory(TempDynamicString.Buffer, TAG_USTR);
}
/* Print out any unusual errors */

View file

@ -61,7 +61,7 @@ RtlpQueryRegistryDirect(IN ULONG ValueType,
if (!ReturnString->Buffer)
{
/* Allocate it */
ReturnString->Buffer = RtlpAllocateMemory(ActualLength, TAG_RTLREGISTRY);
ReturnString->Buffer = RtlpAllocateStringMemory(ActualLength, TAG_RTLREGISTRY);
if (!ReturnString->Buffer) return STATUS_NO_MEMORY;
ReturnString->MaximumLength = ActualLength;
}