summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-11 15:11:42 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-11 15:15:57 +0200
commit5087b2b32f28da82b2d5675e0fed37f5fb01107d (patch)
tree15033304817c223645e7ccb704d9d6356b6a2962
parent0afccb560bd9c6f48954cd27bddde968d3979a00 (diff)
downloadserenity-5087b2b32f28da82b2d5675e0fed37f5fb01107d.zip
AK: Don't forget to kfree_sized() in ByteBuffer
-rw-r--r--AK/ByteBuffer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h
index a6a4b9fe43..f3a85f9f55 100644
--- a/AK/ByteBuffer.h
+++ b/AK/ByteBuffer.h
@@ -243,8 +243,10 @@ private:
new_capacity = kmalloc_good_size(new_capacity);
if (!m_inline) {
new_buffer = (u8*)kmalloc(new_capacity);
- if (m_outline_buffer)
+ if (m_outline_buffer) {
__builtin_memcpy(new_buffer, m_outline_buffer, min(new_capacity, m_outline_capacity));
+ kfree_sized(m_outline_buffer, m_outline_capacity);
+ }
VERIFY(new_buffer);
} else {
new_buffer = (u8*)kmalloc(new_capacity);