diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-23 15:31:23 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-23 15:31:23 +0200 |
commit | 1c1d0f53625a3877985bb639dead7a1851abde20 (patch) | |
tree | ab7440fcda1b569ea1d726cb0bb1a7e25f758aba /ELFLoader/ExecSpace.cpp | |
parent | ccd15e0590e5bf622caf907bbcb25ce8b1fd0155 (diff) | |
download | serenity-1c1d0f53625a3877985bb639dead7a1851abde20.zip |
ExecSpace should free its own allocations on destruction.
If hookableAlloc was used, we don't free anything. That's the client's
responsibility.
Diffstat (limited to 'ELFLoader/ExecSpace.cpp')
-rw-r--r-- | ELFLoader/ExecSpace.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ELFLoader/ExecSpace.cpp b/ELFLoader/ExecSpace.cpp index 33172c29d6..e15805ac86 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 |