Author: fireball
Date: Fri Oct 12 19:42:08 2007
New Revision: 29541
URL:
http://svn.reactos.org/svn/reactos?rev=29541&view=rev
Log:
- Don't free a NULL pointer.
Modified:
trunk/reactos/ntoskrnl/cm/regfile.c
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/regfile.c (original)
+++ trunk/reactos/ntoskrnl/cm/regfile.c Fri Oct 12 19:42:08 2007
@@ -27,7 +27,7 @@
IN PUNICODE_STRING FileName,
IN ULONG Flags)
{
- PEREGISTRY_HIVE Hive;
+ PEREGISTRY_HIVE Hive = NULL;
NTSTATUS Status;
BOOLEAN Allocate = TRUE;
@@ -43,7 +43,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT1("CmpInitHiveFromFile() failed (Status %lx)\n", Status);
- ExFreePool(Hive);
+ if (Hive) ExFreePool(Hive);
return Status;
}