Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e8fa067

Browse filesBrowse files
sam-githubtargos
authored andcommitted
tls: destroy trace BIO instead of leaking it
Fixes: #27636 (comment) PR-URL: #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>
1 parent 85f505c commit e8fa067
Copy full SHA for e8fa067

File tree

Expand file treeCollapse file tree

2 files changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎src/tls_wrap.cc‎

Copy file name to clipboardExpand all lines: src/tls_wrap.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,9 @@ void TLSWrap::EnableTrace(
939939

940940
#if HAVE_SSL_TRACE
941941
if (wrap->ssl_) {
942-
BIO* b = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
942+
wrap->bio_trace_.reset(BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT));
943943
SSL_set_msg_callback(wrap->ssl_.get(), SSL_trace);
944-
SSL_set_msg_callback_arg(wrap->ssl_.get(), b);
944+
SSL_set_msg_callback_arg(wrap->ssl_.get(), wrap->bio_trace_.get());
945945
}
946946
#endif
947947
}
Collapse file

‎src/tls_wrap.h‎

Copy file name to clipboardExpand all lines: src/tls_wrap.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ class TLSWrap : public AsyncWrap,
193193
private:
194194
static void GetWriteQueueSize(
195195
const v8::FunctionCallbackInfo<v8::Value>& info);
196+
197+
crypto::BIOPointer bio_trace_;
196198
};
197199

198200
} // namespace node

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.