From 9f8fbe14f5e48a0ff391078866bbfddcfe16d222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Bi=C8=99oc?= Date: Sun, 8 May 2022 19:16:34 +0200 Subject: [PATCH] [NTOS:OB] Specify the query security descriptor tag when freeing the allocation We are allocating blocks of pool memory for a security descriptor with its own specific tag, TAG_SEC_QUERY, so just use it when freeing when releasing the descriptor as well (aka freeing the said pool). --- ntoskrnl/ob/obsecure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/ob/obsecure.c b/ntoskrnl/ob/obsecure.c index 135b7b2f5e1..649ba4ea283 100644 --- a/ntoskrnl/ob/obsecure.c +++ b/ntoskrnl/ob/obsecure.c @@ -718,7 +718,7 @@ ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor, if (MemoryAllocated) { /* Free it */ - ExFreePool(SecurityDescriptor); + ExFreePoolWithTag(SecurityDescriptor, TAG_SEC_QUERY); } else {