diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 69293ad906e614..2b0da3e3bcf4b4 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 } diff --git a/src/tls_wrap.h b/src/tls_wrap.h index b866bbb7af122e..e2ff68205730c6 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -193,6 +193,8 @@ class TLSWrap : public AsyncWrap, private: static void GetWriteQueueSize( const v8::FunctionCallbackInfo& info); + + crypto::BIOPointer bio_trace_; }; } // namespace node