summaryrefslogtreecommitdiff
path: root/src/node_crypto.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2017-07-10 12:56:37 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2017-07-17 23:09:52 +0200
commitaa1c8c00437ae2bf5aa0bc980b027013b8dd7e39 (patch)
tree82dfed6fe3d1d9fc0ca5099f6629841ed17286fc /src/node_crypto.h
parent58926d407574338688077a37d8832a585dcc8503 (diff)
downloadandroid-node-v8-aa1c8c00437ae2bf5aa0bc980b027013b8dd7e39.tar.gz
android-node-v8-aa1c8c00437ae2bf5aa0bc980b027013b8dd7e39.tar.bz2
android-node-v8-aa1c8c00437ae2bf5aa0bc980b027013b8dd7e39.zip
src: fix memory leak in DH key setters
Fix a memory leak in dh.setPublicKey() and dh.setPrivateKey() where the old keys weren't freed. Fixes: https://github.com/nodejs/node/issues/8377 PR-URL: https://github.com/nodejs/node/pull/14122 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r--src/node_crypto.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 01c799a8b1..1d823bcb35 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -692,6 +692,8 @@ class DiffieHellman : public BaseObject {
private:
static void GetField(const v8::FunctionCallbackInfo<v8::Value>& args,
BIGNUM* (DH::*field), const char* err_if_null);
+ static void SetKey(const v8::FunctionCallbackInfo<v8::Value>& args,
+ BIGNUM* (DH::*field), const char* what);
bool VerifyContext();
bool initialised_;