diff options
Diffstat (limited to 'src/Buffer.cpp')
-rw-r--r-- | src/Buffer.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 7cbbe57..dff2623 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -73,8 +73,10 @@ void Buffer::setLength(size_t len) /* Align to 32-byte boundary for AVX. */ data = memalign(32, len); - memcpy(data, tmp, this->len); - free(tmp); + if (tmp != NULL) { + memcpy(data, tmp, this->len); + free(tmp); + } size = len; } this->len = len; @@ -97,14 +99,3 @@ void Buffer::appendData(const void *data, size_t len) } } - -size_t Buffer::getLength() -{ - return len; -} - - -void *Buffer::getData() -{ - return data; -} |