diff --git a/ntoskrnl/config/cmapi.c b/ntoskrnl/config/cmapi.c index 2b36c10b3e55f..fd1eebd087667 100644 --- a/ntoskrnl/config/cmapi.c +++ b/ntoskrnl/config/cmapi.c @@ -41,7 +41,11 @@ CmpIsHiveAlreadyLoaded(IN HANDLE KeyHandle, if (!NT_SUCCESS(Status)) return Loaded; /* Don't touch deleted KCBs */ - if (KeyBody->KeyControlBlock->Delete) return Loaded; + if (KeyBody->KeyControlBlock->Delete) + { + ObDereferenceObject(KeyBody); + return Loaded; + } Hive = CONTAINING_RECORD(KeyBody->KeyControlBlock->KeyHive, CMHIVE, Hive); diff --git a/ntoskrnl/io/iomgr/bootlog.c b/ntoskrnl/io/iomgr/bootlog.c index 4c262c4af037a..feb2044ee9c9b 100644 --- a/ntoskrnl/io/iomgr/bootlog.c +++ b/ntoskrnl/io/iomgr/bootlog.c @@ -232,8 +232,6 @@ IopCreateLogFile(VOID) DPRINT("IopSaveBootLogToFile() called\n"); - ExAcquireResourceExclusiveLite(&IopBootLogResource, TRUE); - RtlInitUnicodeString(&FileName, L"\\SystemRoot\\rosboot.log"); InitializeObjectAttributes(&ObjectAttributes, diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 64b692ea2aab2..a122540aedb10 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -1852,7 +1852,11 @@ NtLockFile(IN HANDLE FileHandle, PreviousMode, (PVOID *)&Event, NULL); - if (Status != STATUS_SUCCESS) return Status; + if (Status != STATUS_SUCCESS) + { + ObDereferenceObject(FileObject); + return Status; + } KeClearEvent(Event); } diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index 2b92983a9a0cc..c40851e289101 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -444,8 +444,7 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid) if (!NewList) { - /* Fail */ - ExFreePool(PnpBusTypeGuidList); + /* Fail without destroying existing list data */ goto Quickie; } diff --git a/ntoskrnl/po/power.c b/ntoskrnl/po/power.c index 18ba3f6e62b1a..189bc71aa9e70 100644 --- a/ntoskrnl/po/power.c +++ b/ntoskrnl/po/power.c @@ -349,6 +349,7 @@ PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState, POWER_ACTION PowerAction) if (Fdo == DeviceObject) { DPRINT("An FDO was not attached\n"); + ObDereferenceObject(Fdo); return STATUS_UNSUCCESSFUL; } } diff --git a/ntoskrnl/ps/psmgr.c b/ntoskrnl/ps/psmgr.c index 0d80257bd46cd..d884aed9e5f0d 100644 --- a/ntoskrnl/ps/psmgr.c +++ b/ntoskrnl/ps/psmgr.c @@ -223,6 +223,7 @@ PsLocateSystemDll(VOID) &HardErrorParameters, OptionOk, &HardErrorResponse); + ZwClose(FileHandle); return Status; }