summaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-05-22 21:07:07 -0700
committerAnna Henningsen <anna@addaleax.net>2019-05-26 14:35:14 +0200
commit725a66a2f0e99304b927888bd5928c358ce656b9 (patch)
treec147843ec100dc56751d6cfa3eb54cf189f76b7d /src/tls_wrap.cc
parentdd6481a183d38c7b48864c558ca5383164825b01 (diff)
downloadandroid-node-v8-725a66a2f0e99304b927888bd5928c358ce656b9.tar.gz
android-node-v8-725a66a2f0e99304b927888bd5928c358ce656b9.tar.bz2
android-node-v8-725a66a2f0e99304b927888bd5928c358ce656b9.zip
tls: destroy trace BIO instead of leaking it
Fixes: https://github.com/nodejs/node/issues/27636#issuecomment-491343214 PR-URL: https://github.com/nodejs/node/pull/27834 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 69293ad906..2b0da3e3bc 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -939,9 +939,9 @@ void TLSWrap::EnableTrace(
#if HAVE_SSL_TRACE
if (wrap->ssl_) {
- BIO* b = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
+ wrap->bio_trace_.reset(BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT));
SSL_set_msg_callback(wrap->ssl_.get(), SSL_trace);
- SSL_set_msg_callback_arg(wrap->ssl_.get(), b);
+ SSL_set_msg_callback_arg(wrap->ssl_.get(), wrap->bio_trace_.get());
}
#endif
}