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 2010-11-24 10:34:53 -06:00 committed by Ryan Dahl
parent 7fcfb7b981
commit 6285fac232

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_));
}