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:
255650f
)
crypto: fix memory leak in randomBytes() error path
author
Ben Noordhuis
<info@bnoordhuis.nl>
Fri, 16 Aug 2013 14:49:00 +0000
(16:49 +0200)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Fri, 16 Aug 2013 14:50:01 +0000
(16:50 +0200)
This is the conceptual back-port of commit ec54873 from the master
branch.
src/node_crypto.cc
patch
|
blob
|
history
diff --git
a/src/node_crypto.cc
b/src/node_crypto.cc
index
02b0660
..
409be35
100644
(file)
--- a/
src/node_crypto.cc
+++ b/
src/node_crypto.cc
@@
-4011,7
+4011,9
@@
void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
Buffer* buffer = Buffer::New(req->data_, req->size_, RandomBytesFree, NULL);
argv[0] = Local<Value>::New(Null());
argv[1] = Local<Object>::New(buffer->handle_);
+ req->data_ = NULL;
}
+ free(req->data_);
}