diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2019-06-14 15:05:40 +0300 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-14 16:14:49 +0200 |
commit | 6bb7c803650e739fcc25986b7eb29698b7a531cd (patch) | |
tree | 7613f9fa0072b22c47b6316e1e56176f4af8bb40 /Kernel/VM | |
parent | 118cb391dddb33ca528309e1526464bd824b7e72 (diff) | |
download | serenity-6bb7c803650e739fcc25986b7eb29698b7a531cd.zip |
VM: Fix leaking PhysicalPage instances.
After PhysicalPage::return_to_freelist(), an actual physical page
is returned back to the memory manager; which will create a new
PhysicalPage instance if it decides to reuse the physical page. This
means this PhysicalPage instance should be freed; otherwise it would
get leaked.
Diffstat (limited to 'Kernel/VM')
-rw-r--r-- | Kernel/VM/PhysicalPage.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Kernel/VM/PhysicalPage.h b/Kernel/VM/PhysicalPage.h index 5ac8ad7aac..422cdbe03f 100644 --- a/Kernel/VM/PhysicalPage.h +++ b/Kernel/VM/PhysicalPage.h @@ -24,8 +24,7 @@ public: if (!--m_retain_count) { if (m_may_return_to_freelist) move(*this).return_to_freelist(); - else - delete this; + delete this; } } |