From 1c1d0f53625a3877985bb639dead7a1851abde20 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 23 Oct 2018 15:31:23 +0200 Subject: [PATCH] ExecSpace should free its own allocations on destruction. If hookableAlloc was used, we don't free anything. That's the client's responsibility. --- ELFLoader/ExecSpace.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ELFLoader/ExecSpace.cpp b/ELFLoader/ExecSpace.cpp index 33172c29d6f..e15805ac864 100644 --- a/ELFLoader/ExecSpace.cpp +++ b/ELFLoader/ExecSpace.cpp @@ -12,6 +12,10 @@ ExecSpace::ExecSpace() ExecSpace::~ExecSpace() { + if (!hookableAlloc) { + for (auto& area : m_areas) + kfree(area->memory); + } } #ifdef SERENITY