tls: fix leak on DoWrite()
errors
It is very unlikely to happen, but still the write request should be disposed in case of immediate failure. PR-URL: https://github.com/iojs/io.js/pull/1154 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
056ed4b0c9
commit
e90ed790c3
@ -306,11 +306,13 @@ void TLSWrap::EncOut() {
|
||||
uv_buf_t buf[ARRAY_SIZE(data)];
|
||||
for (size_t i = 0; i < count; i++)
|
||||
buf[i] = uv_buf_init(data[i], size[i]);
|
||||
int r = stream_->DoWrite(write_req, buf, count, nullptr);
|
||||
int err = stream_->DoWrite(write_req, buf, count, nullptr);
|
||||
write_req->Dispatched();
|
||||
|
||||
// Ignore errors, this should be already handled in js
|
||||
if (!r)
|
||||
if (err)
|
||||
write_req->Dispose();
|
||||
else
|
||||
NODE_COUNT_NET_BYTES_SENT(write_size_);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user