Browse Source

Fix memory leak on fs.write()

Reported by onne@onnlucky.com.
v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
1cacb50f2b
  1. 4
      src/node_file.cc

4
src/node_file.cc

@ -118,6 +118,10 @@ int EIOPromise::After(eio_req *req) {
Local<Value> exception = Exception::Error( Local<Value> exception = Exception::Error(
String::NewSymbol(strerror(req->errorno))); String::NewSymbol(strerror(req->errorno)));
promise->EmitError(1, &exception); promise->EmitError(1, &exception);
if (req->type == EIO_WRITE) {
assert(req->ptr2);
delete [] req->ptr2;
}
return 0; return 0;
} }

Loading…
Cancel
Save