summaryrefslogtreecommitdiff
path: root/src/node_crypto.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2018-02-21 15:24:18 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2018-02-21 15:24:18 +0100
commit992703f2b50f6b3483e9b930737d177b9e01256d (patch)
tree7d9b2752b6021d7653d426bbebdc80a437624a47 /src/node_crypto.h
parente53275d819fb21d4bb15a27a714f134551233cf9 (diff)
downloadandroid-node-v8-992703f2b50f6b3483e9b930737d177b9e01256d.tar.gz
android-node-v8-992703f2b50f6b3483e9b930737d177b9e01256d.tar.bz2
android-node-v8-992703f2b50f6b3483e9b930737d177b9e01256d.zip
src: prevent persistent handle resource leaks
Replace v8::Persistent with node::Persistent, a specialization that resets the persistent handle on destruction. Prevents accidental resource leaks when forgetting to call .Reset() manually. I'm fairly confident this commit fixes a number of resource leaks that have gone undiagnosed so far. PR-URL: https://github.com/nodejs/node/pull/18656 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r--src/node_crypto.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 7ce40697d4..1c17dc1081 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -353,11 +353,11 @@ class SSLWrap {
ClientHelloParser hello_parser_;
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
- v8::Persistent<v8::Object> ocsp_response_;
+ Persistent<v8::Object> ocsp_response_;
#endif // NODE__HAVE_TLSEXT_STATUS_CB
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
- v8::Persistent<v8::Value> sni_context_;
+ Persistent<v8::Value> sni_context_;
#endif
friend class SecureContext;