diff --git a/lib/buffer.js b/lib/buffer.js index e5588963df4c4b..9b43882e574d50 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -104,7 +104,9 @@ function Buffer(subject, encoding) { var prevLen = this.length; this.length = len; truncate(this, this.length); - poolOffset -= (prevLen - len); + // Only need to readjust the poolOffset if the allocation is a slice. + if (this.parent != undefined) + poolOffset -= (prevLen - len); } } else if (util.isBuffer(subject)) {