Skip to content

Commit 6285fac

Browse files
thughesry
authored andcommitted
Allocations with new[] must be freed with delete[].
See http://valgrind.org/docs/manual/mc-manual.html#mc-manual.rudefn
1 parent 7fcfb7b commit 6285fac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_buffer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void Buffer::Replace(char *data, size_t length,
176176
if (callback_) {
177177
callback_(data_, callback_hint_);
178178
} else if (length_) {
179-
delete data_;
179+
delete [] data_;
180180
V8::AdjustAmountOfExternalAllocatedMemory(-(sizeof(Buffer) + length_));
181181
}
182182

0 commit comments

Comments
 (0)