diff --git a/ntoskrnl/se/priv.c b/ntoskrnl/se/priv.c index a1013b1844b..ffab568d492 100644 --- a/ntoskrnl/se/priv.c +++ b/ntoskrnl/se/priv.c @@ -562,6 +562,7 @@ SeReleaseLuidAndAttributesArray( (PreviousMode != KernelMode || CaptureIfKernel)) { ExFreePoolWithTag(Privilege, TAG_LUID); + Privilege = NULL; } } diff --git a/ntoskrnl/se/sid.c b/ntoskrnl/se/sid.c index 509b3777488..d6c0f4ad912 100644 --- a/ntoskrnl/se/sid.c +++ b/ntoskrnl/se/sid.c @@ -776,6 +776,7 @@ SeReleaseSidAndAttributesArray( ((AccessMode != KernelMode) || CaptureIfKernel)) { ExFreePoolWithTag(CapturedSidAndAttributes, TAG_SID_AND_ATTRIBUTES); + CapturedSidAndAttributes = NULL; } } diff --git a/ntoskrnl/se/token.c b/ntoskrnl/se/token.c index fa4a0e8d847..a2a232343a7 100644 --- a/ntoskrnl/se/token.c +++ b/ntoskrnl/se/token.c @@ -3,7 +3,7 @@ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) * PURPOSE: Security token implementation support * COPYRIGHT: Copyright David Welch - * Copyright 2021 George Bișoc + * Copyright 2021-2022 George Bișoc */ /* INCLUDES *******************************************************************/ @@ -6819,8 +6819,6 @@ Quit: SeReleaseSidAndAttributesArray(CapturedSids, PreviousMode, TRUE); - - CapturedSids = NULL; } if (CapturedPrivileges != NULL) @@ -6828,8 +6826,6 @@ Quit: SeReleaseLuidAndAttributesArray(CapturedPrivileges, PreviousMode, TRUE); - - CapturedPrivileges = NULL; } if (CapturedRestrictedSids != NULL) @@ -6837,8 +6833,6 @@ Quit: SeReleaseSidAndAttributesArray(CapturedRestrictedSids, PreviousMode, TRUE); - - CapturedRestrictedSids = NULL; } return Status;