https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ffd524275e721a192b91c…
commit ffd524275e721a192b91cbc65819ee377043eb79
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Mar 25 18:26:32 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Mar 25 18:27:19 2018 +0200
[NTOSKRNL] Properly delete VACB in CcRosCreateVacb() when mapping fails.
Spotted by Thomas.
CORE-14478
CORE-14502
---
ntoskrnl/cc/view.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index 9cc45bdb3e..ba87c5e510 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -831,18 +831,20 @@ CcRosCreateVacb (
}
#endif
+ /* Reference it to allow release */
+ CcRosVacbIncRefCount(current);
+
Status = CcRosMapVacbInKernelSpace(current);
if (!NT_SUCCESS(Status))
{
RemoveEntryList(¤t->CacheMapVacbListEntry);
RemoveEntryList(¤t->VacbLruListEntry);
- CcRosReleaseVacbLock(current);
+ CcRosReleaseVacb(SharedCacheMap, current, FALSE,
+ FALSE, FALSE);
+ CcRosVacbDecRefCount(current);
ExFreeToNPagedLookasideList(&VacbLookasideList, current);
}
- /* Reference it to allow release */
- CcRosVacbIncRefCount(current);
-
return Status;
}