projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00bffa6
)
src: better error message on failed Buffer malloc
author
Karl Skomski
<karl@skomski.com>
Mon, 17 Aug 2015 20:51:42 +0000
(22:51 +0200)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Tue, 18 Aug 2015 11:51:05 +0000
(13:51 +0200)
PR-URL: https://github.com/nodejs/node/pull/2422
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
src/node_buffer.cc
patch
|
blob
|
history
diff --git
a/src/node_buffer.cc
b/src/node_buffer.cc
index
76a7333
..
c8be5b5
100644
(file)
--- a/
src/node_buffer.cc
+++ b/
src/node_buffer.cc
@@
-408,8
+408,10
@@
void Create(const FunctionCallbackInfo<Value>& args) {
void* data;
if (length > 0) {
data = malloc(length);
- if (data == nullptr)
- return env->ThrowRangeError("invalid Buffer length");
+ if (data == nullptr) {
+ return env->ThrowRangeError(
+ "Buffer allocation failed - process out of memory");
+ }
} else {
data = nullptr;
}