Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,10 @@ inline AllocatedBuffer::~AllocatedBuffer() {

inline void AllocatedBuffer::clear() {
uv_buf_t buf = release();
env_->Free(buf.base, buf.len);
if (buf.base != nullptr) {
CHECK_NOT_NULL(env_);
env_->Free(buf.base, buf.len);
}
}

// It's a bit awkward to define this Buffer::New() overload here, but it
Expand Down