mirror of https://github.com/nodejs/node.git
Guard failed buffer constructions.
Thanks to Jeremy Barnes for pointing it out.v0.7.4-release
parent
391f087981
commit
8b33a1d8e4
|
@ -134,6 +134,7 @@ Buffer* Buffer::New(size_t length) {
|
|||
|
||||
Local<Value> arg = Integer::NewFromUnsigned(length);
|
||||
Local<Object> b = constructor_template->GetFunction()->NewInstance(1, &arg);
|
||||
if (b.IsEmpty()) return NULL;
|
||||
|
||||
return ObjectWrap::Unwrap<Buffer>(b);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue