From a1b63b612c466ba74aef3510f419659f0fc56971 Mon Sep 17 00:00:00 2001 From: Hongli Lai Date: Sun, 13 Oct 2024 16:33:26 +0200 Subject: [PATCH] Fix heap-use-after-free --- src/agent/Core/ApplicationPool/Process.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agent/Core/ApplicationPool/Process.h b/src/agent/Core/ApplicationPool/Process.h index cd91f2e0e9..9f67fd638c 100644 --- a/src/agent/Core/ApplicationPool/Process.h +++ b/src/agent/Core/ApplicationPool/Process.h @@ -337,8 +337,9 @@ class Process { } void destroySelf() const { + Context *context = getContext(); this->~Process(); - LockGuard l(getContext()->memoryManagementSyncher); + LockGuard l(context->memoryManagementSyncher); getContext()->processObjectPool.free(const_cast(this)); }