diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-11-30 16:28:50 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-11-30 18:19:54 -0800 |
commit | 355936dcde19c23ea6d4ccb6b87532ee38900129 (patch) | |
tree | f3f4093a89ab00dc0de2a882021703933a40f448 /src | |
parent | ea540c94f8071acd8c21ab0955894727de3b4087 (diff) | |
download | node-new-355936dcde19c23ea6d4ccb6b87532ee38900129.tar.gz |
Implement SecureContext destructor
Diffstat (limited to 'src')
-rw-r--r-- | src/node_crypto.cc | 1 | ||||
-rw-r--r-- | src/node_crypto.h | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 0ab886ef6b..d46ed1e062 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -263,6 +263,7 @@ Handle<Value> SecureContext::Close(const Arguments& args) { if (sc->ctx_ != NULL) { SSL_CTX_free(sc->ctx_); + sc->ctx_ = NULL; return True(); } diff --git a/src/node_crypto.h b/src/node_crypto.h index 9f81be6f23..817724189f 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -40,7 +40,15 @@ class SecureContext : ObjectWrap { } ~SecureContext() { - // Free up + if (ctx_) { + SSL_CTX_free(ctx_); + ctx_ = NULL; + } + + if (ca_store_) { + X509_STORE_free(ca_store_); + ca_store_ = NULL; + } } private: |