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:
8be6a89
)
Fix memory leak on fs.write()
author
Ryan Dahl
<ry@tinyclouds.org>
Sat, 21 Nov 2009 23:47:26 +0000
(
00:47
+0100)
committer
Ryan Dahl
<ry@tinyclouds.org>
Sat, 21 Nov 2009 23:47:36 +0000
(
00:47
+0100)
Reported by onne@onnlucky.com.
src/node_file.cc
patch
|
blob
|
history
diff --git
a/src/node_file.cc
b/src/node_file.cc
index
f4cda23
..
399ec88
100644
(file)
--- a/
src/node_file.cc
+++ b/
src/node_file.cc
@@
-118,6
+118,10
@@
int EIOPromise::After(eio_req *req) {
Local<Value> exception = Exception::Error(
String::NewSymbol(strerror(req->errorno)));
promise->EmitError(1, &exception);
+ if (req->type == EIO_WRITE) {
+ assert(req->ptr2);
+ delete [] req->ptr2;
+ }
return 0;
}