summaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2015-03-07 11:41:22 -0500
committerFedor Indutny <fedor@indutny.com>2015-03-07 18:51:05 -0500
commit7f4c95e16078451ee35dd61aba0f9d5fe99cc710 (patch)
tree4c2822f432909d4a012d439209676e4794aae848 /src/tls_wrap.cc
parente763220f6643249d97eb1290e21e785e02874f48 (diff)
downloadandroid-node-v8-7f4c95e16078451ee35dd61aba0f9d5fe99cc710.tar.gz
android-node-v8-7f4c95e16078451ee35dd61aba0f9d5fe99cc710.tar.bz2
android-node-v8-7f4c95e16078451ee35dd61aba0f9d5fe99cc710.zip
tls: do not leak WriteWrap objects
Kill WriteWrap instances that are allocated in `tls_wrap.cc` internally. Fix: https://github.com/iojs/io.js/issues/1075 PR-URL: https://github.com/iojs/io.js/pull/1090 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index a42e5faa70..e3dc1e1885 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -305,6 +305,7 @@ void TLSWrap::EncOut() {
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);
+ write_req->Dispatched();
// Ignore errors, this should be already handled in js
if (!r)
@@ -314,6 +315,8 @@ void TLSWrap::EncOut() {
void TLSWrap::EncOutCb(WriteWrap* req_wrap, int status) {
TLSWrap* wrap = req_wrap->wrap()->Cast<TLSWrap>();
+ req_wrap->~WriteWrap();
+ delete[] reinterpret_cast<char*>(req_wrap);
// Handle error
if (status) {