Allocations with new[] must be freed with delete[].

See http://valgrind.org/docs/manual/mc-manual.html#mc-manual.rudefn
This commit is contained in:
Tom Hughes authored and Ryan Dahl committed 2010-11-24 12:53:28 -08:00
1 parent 7fcfb7b981
commit 6285fac232
1 file changed
+1 -1
+1 -1
View File
@@ -176,7 +176,7 @@ void Buffer::Replace(char *data, size_t length,
if (callback_) {
callback_(data_, callback_hint_);
} else if (length_) {
delete data_;
delete [] data_;
V8::AdjustAmountOfExternalAllocatedMemory(-(sizeof(Buffer) + length_));
}