diff --git a/lib/buffer.js b/lib/buffer.js index 3e690901e1cbf0..bb3047579bbf1b 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -84,7 +84,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 (subject instanceof Buffer) {