https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e51c305f516f99514b910…
commit e51c305f516f99514b910c9ecc8b498630fb1fbc
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Mar 21 21:04:44 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Mar 25 18:54:21 2022 +0100
[SDK:RTL] Consistently use the Allocate/FreeStringMemory helpers when
allocating/freeing string buffers.
---
sdk/lib/rtl/path.c | 4 ++--
sdk/lib/rtl/registry.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sdk/lib/rtl/path.c b/sdk/lib/rtl/path.c
index 360c68df735..e045e16ebb4 100644
--- a/sdk/lib/rtl/path.c
+++ b/sdk/lib/rtl/path.c
@@ -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 */
diff --git a/sdk/lib/rtl/registry.c b/sdk/lib/rtl/registry.c
index bc69d4d0b33..3172213265f 100644
--- a/sdk/lib/rtl/registry.c
+++ b/sdk/lib/rtl/registry.c
@@ -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;
}