summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-25 07:38:18 -0800
committerPixel <pixel@nobis-crew.org>2011-11-25 07:38:18 -0800
commit9fbc552b4496234a4023dbd18165d9ad8305587d (patch)
tree00d1e5cac7d87e2d220821f489bd8165aa6e82eb /src
parentedae25d41d89564a21e0e0a11b4cde2287ba889e (diff)
If a Buffer came from const, don't try to free its memory...
Diffstat (limited to 'src')
-rw-r--r--src/Buffer.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Buffer.cc b/src/Buffer.cc
index a958571..25639b7 100644
--- a/src/Buffer.cc
+++ b/src/Buffer.cc
@@ -60,7 +60,8 @@ ssize_t Balau::Buffer::write(const void * buf, size_t count) throw (GeneralExcep
}
void Balau::Buffer::reset() {
- m_buffer = (uint8_t *) realloc(m_buffer, 0);
+ if (!m_fromConst)
+ m_buffer = (uint8_t *) realloc(m_buffer, 0);
m_bufSize = 0;
m_numBlocks = 0;
wseek(0);