https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6a03fb7099eb4b1a36e24d9c99e36265d2948bfc

commit 6a03fb7099eb4b1a36e24d9c99e36265d2948bfc
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Mar 27 18:44:53 2022 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sat Apr 16 18:33:24 2022 +0200

    [SDK:CMLIB] Use Hive->Allocate / Hive->Free where possible.
---
 sdk/lib/cmlib/cmindex.c | 14 +++++---------
 sdk/lib/cmlib/cmvalue.c |  2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/sdk/lib/cmlib/cmindex.c b/sdk/lib/cmlib/cmindex.c
index 0e6ccf04c2a..9ab2ae9931e 100644
--- a/sdk/lib/cmlib/cmindex.c
+++ b/sdk/lib/cmlib/cmindex.c
@@ -793,9 +793,7 @@ CmpMarkIndexDirty(IN PHHIVE Hive,
         SearchName.Length = CmpCompressedNameSize(Node->Name,
                                                   Node->NameLength);
         SearchName.MaximumLength = SearchName.Length;
-        SearchName.Buffer = CmpAllocate(SearchName.Length,
-                                        TRUE,
-                                        TAG_CM);
+        SearchName.Buffer = Hive->Allocate(SearchName.Length, TRUE, TAG_CM);
         if (!SearchName.Buffer)
         {
             /* Fail */
@@ -889,7 +887,7 @@ CmpMarkIndexDirty(IN PHHIVE Hive,
             if (Child != HCELL_NIL)
             {
                 /* We found it, free the name now */
-                if (IsCompressed) CmpFree(SearchName.Buffer, 0);
+                if (IsCompressed) Hive->Free(SearchName.Buffer, 0);
 
                 /* Release the parent key */
                 HvReleaseCell(Hive, ParentKey);
@@ -914,7 +912,7 @@ Quickie:
     if (CellToRelease != HCELL_NIL) HvReleaseCell(Hive, CellToRelease);
 
     /* Free the search name and return failure */
-    if (IsCompressed) CmpFree(SearchName.Buffer, 0);
+    if (IsCompressed) Hive->Free(SearchName.Buffer, 0);
     return FALSE;
 }
 
@@ -1731,9 +1729,7 @@ CmpRemoveSubKey(IN PHHIVE Hive,
         if (SearchName.MaximumLength > sizeof(Buffer))
         {
             /* Allocate one */
-            SearchName.Buffer = CmpAllocate(SearchName.Length,
-                                            TRUE,
-                                            TAG_CM);
+            SearchName.Buffer = Hive->Allocate(SearchName.Length, TRUE, 
TAG_CM);
             if (!SearchName.Buffer) return FALSE;
         }
         else
@@ -1872,7 +1868,7 @@ Exit:
     if ((IsCompressed) && (SearchName.MaximumLength > sizeof(Buffer)))
     {
         /* Free the buffer we allocated */
-        CmpFree(SearchName.Buffer, 0);
+        Hive->Free(SearchName.Buffer, 0);
     }
 
     /* Return the result */
diff --git a/sdk/lib/cmlib/cmvalue.c b/sdk/lib/cmlib/cmvalue.c
index a9c46a9fcdf..2a5e69d4175 100644
--- a/sdk/lib/cmlib/cmvalue.c
+++ b/sdk/lib/cmlib/cmvalue.c
@@ -194,7 +194,7 @@ CmpValueToData(IN PHHIVE Hive,
     if (BufferAllocated)
     {
         /* Free the buffer and bugcheck */
-        CmpFree(Buffer, 0);
+        Hive->Free(Buffer, 0);
         KeBugCheckEx(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value);
     }
 

Reply via email to