Fix memory leak on fs.write()

Reported by onne@onnlucky.com.
This commit is contained in:
Ryan Dahl committed 2009-11-22 00:47:36 +01:00
1 parent 8be6a89654
commit 1cacb50f2b
1 file changed
+4
+4
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;
}