[SDK][CMLIB] Properly check for failure if hive free list creation fails
authorGeorge Bișoc <george.bisoc@reactos.org>
Fri, 30 Dec 2022 18:47:21 +0000 (19:47 +0100)
committerGeorge Bișoc <george.bisoc@reactos.org>
Fri, 30 Dec 2022 18:58:37 +0000 (19:58 +0100)
HvpCreateHiveFreeCellList returns a NTSTATUS code yet the way the code path checks
checks for failure is just wrong. This was spotted whilst working on #4571 PR.

sdk/lib/cmlib/hiveinit.c

index 2b070fb..3eee62d 100644 (file)
@@ -306,7 +306,7 @@ HvpInitializeMemoryHive(
         BlockIndex += Bin->Size / HBLOCK_SIZE;
     }
 
-    if (HvpCreateHiveFreeCellList(Hive))
+    if (!NT_SUCCESS(HvpCreateHiveFreeCellList(Hive)))
     {
         HvpFreeHiveBins(Hive);
         Hive->Free(Hive->BaseBlock, Hive->BaseBlockAlloc);