summaryrefslogtreecommitdiff
path: root/AK/Buffer.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-11 12:30:35 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-11 12:30:35 +0200
commitf282df661724334fbf5f0b9d3123162aad57d1fa (patch)
tree64b88e74aa295f766cc17c036dbb9e7570ab90b6 /AK/Buffer.h
parent0abc19b0ff50b5919f7cbac180af822638f89652 (diff)
downloadserenity-f282df661724334fbf5f0b9d3123162aad57d1fa.zip
AK::Buffer should not free unowned backing stores, duh.
Diffstat (limited to 'AK/Buffer.h')
-rw-r--r--AK/Buffer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/Buffer.h b/AK/Buffer.h
index 21d2da49ed..91ef48cda2 100644
--- a/AK/Buffer.h
+++ b/AK/Buffer.h
@@ -23,7 +23,8 @@ public:
{
if (!m_elements)
return;
- kfree(m_elements);
+ if (m_owned)
+ kfree(m_elements);
m_elements = nullptr;
}