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:
parent
7fcfb7b981
commit
6285fac232
@ -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_));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user