Fix memory leak on fs.write()

Reported by onne@onnlucky.com.
This commit is contained in:
Ryan Dahl
2009-11-22 00:47:26 +01:00
parent 8be6a89654
commit 1cacb50f2b

View File

@@ -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;
}