diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2017-03-17 11:35:28 +0100 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-22 09:41:04 -0700 |
commit | 86d74a248bf82a862104ba2dc63ebc573fd69a4f (patch) | |
tree | a9b815983e423c0ec69145891a60105778a3f125 /src | |
parent | be98f2691736e10053b9826fce42b0ab50604da7 (diff) | |
download | android-node-v8-86d74a248bf82a862104ba2dc63ebc573fd69a4f.tar.gz android-node-v8-86d74a248bf82a862104ba2dc63ebc573fd69a4f.tar.bz2 android-node-v8-86d74a248bf82a862104ba2dc63ebc573fd69a4f.zip |
tls: fix SecurePair external memory reporting
Ensure that AdjustAmountOfExternalAllocatedMemory() is called when
the SecurePair is destroyed. Not doing so is not an actual memory
leak but it makes `process.memoryUsage().external` wildly inaccurate
and can cause performance problems due to excessive garbage collection.
PR-URL: https://github.com/nodejs/node/pull/11896
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_crypto.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 411b8f56d6..7698cf2062 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3248,11 +3248,7 @@ void Connection::Start(const FunctionCallbackInfo<Value>& args) { void Connection::Close(const FunctionCallbackInfo<Value>& args) { Connection* conn; ASSIGN_OR_RETURN_UNWRAP(&conn, args.Holder()); - - if (conn->ssl_ != nullptr) { - SSL_free(conn->ssl_); - conn->ssl_ = nullptr; - } + conn->DestroySSL(); } |